Skip to content

Commit

Permalink
Enable mdbook smart-punctuation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Jun 24, 2024
1 parent 3b68105 commit 973632e
Show file tree
Hide file tree
Showing 16 changed files with 185 additions and 184 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install mdbook
run: |
mkdir bin
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.14/mdbook-v0.4.14-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.40/mdbook-v0.4.40-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
echo "$(pwd)/bin" >> $GITHUB_PATH
- name: Report versions
run: |
Expand Down
10 changes: 5 additions & 5 deletions STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ See https://highlightjs.org/ for a list of supported languages.

Rust examples are tested via rustdoc, and should include the appropriate annotations when tests are expected to fail:

* `edition2015` or `edition2018` — If it is edition-specific (see `book.toml` for the default).
* `no_run` — The example should compile successfully, but should not be executed.
* `should_panic` The example should compile and run, but produce a panic.
* `compile_fail` — The example is expected to fail to compile.
* `ignore` — The example shouldn't be built or tested.
* `edition2015` or `edition2018` --- If it is edition-specific (see `book.toml` for the default).
* `no_run` --- The example should compile successfully, but should not be executed.
* `should_panic` --- The example should compile and run, but produce a panic.
* `compile_fail` --- The example is expected to fail to compile.
* `ignore` --- The example shouldn't be built or tested.
This should be avoided if possible.
Usually this is only necessary when the testing framework does not support it (such as external crates or modules, or a proc-macro), or it contains pseudo-code which is not valid Rust.
An HTML comment such as `<!-- ignore: requires extern crate -->` should be placed before the example to explain why it is ignored.
Expand Down
1 change: 1 addition & 0 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ author = "The Rust Project Developers"
additional-css = ["theme/reference.css"]
git-repository-url = "https://github.com/rust-lang/reference/"
edit-url-template = "https://github.com/rust-lang/reference/edit/master/{path}"
smart-punctuation = true

[output.html.redirect]
"/expressions/enum-variant-expr.html" = "struct-expr.html"
Expand Down
90 changes: 45 additions & 45 deletions src/attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,79 +204,79 @@ pub fn f() {}
The following is an index of all built-in attributes.

- Conditional compilation
- [`cfg`] — Controls conditional compilation.
- [`cfg_attr`] — Conditionally includes attributes.
- [`cfg`] --- Controls conditional compilation.
- [`cfg_attr`] --- Conditionally includes attributes.
- Testing
- [`test`] — Marks a function as a test.
- [`ignore`] — Disables a test function.
- [`should_panic`] — Indicates a test should generate a panic.
- [`test`] --- Marks a function as a test.
- [`ignore`] --- Disables a test function.
- [`should_panic`] --- Indicates a test should generate a panic.
- Derive
- [`derive`] — Automatic trait implementations.
- [`automatically_derived`] — Marker for implementations created by
- [`derive`] --- Automatic trait implementations.
- [`automatically_derived`] --- Marker for implementations created by
`derive`.
- Macros
- [`macro_export`] Exports a `macro_rules` macro for cross-crate usage.
- [`macro_use`] Expands macro visibility, or imports macros from other
- [`macro_export`] --- Exports a `macro_rules` macro for cross-crate usage.
- [`macro_use`] --- Expands macro visibility, or imports macros from other
crates.
- [`proc_macro`] Defines a function-like macro.
- [`proc_macro_derive`] Defines a derive macro.
- [`proc_macro_attribute`] Defines an attribute macro.
- [`proc_macro`] --- Defines a function-like macro.
- [`proc_macro_derive`] --- Defines a derive macro.
- [`proc_macro_attribute`] --- Defines an attribute macro.
- Diagnostics
- [`allow`], [`warn`], [`deny`], [`forbid`] — Alters the default lint level.
- [`deprecated`] — Generates deprecation notices.
- [`must_use`] Generates a lint for unused values.
- [`diagnostic::on_unimplemented`] Hints the compiler to emit a certain error
- [`allow`], [`warn`], [`deny`], [`forbid`] --- Alters the default lint level.
- [`deprecated`] --- Generates deprecation notices.
- [`must_use`] --- Generates a lint for unused values.
- [`diagnostic::on_unimplemented`] --- Hints the compiler to emit a certain error
message if a trait is not implemented.
- ABI, linking, symbols, and FFI
- [`link`] Specifies a native library to link with an `extern` block.
- [`link_name`] Specifies the name of the symbol for functions or statics
- [`link`] --- Specifies a native library to link with an `extern` block.
- [`link_name`] --- Specifies the name of the symbol for functions or statics
in an `extern` block.
- [`link_ordinal`] Specifies the ordinal of the symbol for functions or
- [`link_ordinal`] --- Specifies the ordinal of the symbol for functions or
statics in an `extern` block.
- [`no_link`] — Prevents linking an extern crate.
- [`repr`] — Controls type layout.
- [`crate_type`] Specifies the type of crate (library, executable, etc.).
- [`no_main`] — Disables emitting the `main` symbol.
- [`export_name`] — Specifies the exported symbol name for a function or
- [`no_link`] --- Prevents linking an extern crate.
- [`repr`] --- Controls type layout.
- [`crate_type`] --- Specifies the type of crate (library, executable, etc.).
- [`no_main`] --- Disables emitting the `main` symbol.
- [`export_name`] --- Specifies the exported symbol name for a function or
static.
- [`link_section`] — Specifies the section of an object file to use for a
- [`link_section`] --- Specifies the section of an object file to use for a
function or static.
- [`no_mangle`] — Disables symbol name encoding.
- [`used`] Forces the compiler to keep a static item in the output
- [`no_mangle`] --- Disables symbol name encoding.
- [`used`] --- Forces the compiler to keep a static item in the output
object file.
- [`crate_name`] Specifies the crate name.
- [`crate_name`] --- Specifies the crate name.
- Code generation
- [`inline`] Hint to inline code.
- [`cold`] Hint that a function is unlikely to be called.
- [`no_builtins`] Disables use of certain built-in functions.
- [`target_feature`] — Configure platform-specific code generation.
- [`inline`] --- Hint to inline code.
- [`cold`] --- Hint that a function is unlikely to be called.
- [`no_builtins`] --- Disables use of certain built-in functions.
- [`target_feature`] --- Configure platform-specific code generation.
- [`track_caller`] - Pass the parent call location to `std::panic::Location::caller()`.
- [`instruction_set`] - Specify the instruction set used to generate a functions code
- Documentation
- `doc` — Specifies documentation. See [The Rustdoc Book] for more
- `doc` --- Specifies documentation. See [The Rustdoc Book] for more
information. [Doc comments] are transformed into `doc` attributes.
- Preludes
- [`no_std`] Removes std from the prelude.
- [`no_implicit_prelude`] — Disables prelude lookups within a module.
- [`no_std`] --- Removes std from the prelude.
- [`no_implicit_prelude`] --- Disables prelude lookups within a module.
- Modules
- [`path`] — Specifies the filename for a module.
- [`path`] --- Specifies the filename for a module.
- Limits
- [`recursion_limit`] — Sets the maximum recursion limit for certain
- [`recursion_limit`] --- Sets the maximum recursion limit for certain
compile-time operations.
- [`type_length_limit`] — Sets the maximum size of a polymorphic type.
- [`type_length_limit`] --- Sets the maximum size of a polymorphic type.
- Runtime
- [`panic_handler`] — Sets the function to handle panics.
- [`global_allocator`] Sets the global memory allocator.
- [`windows_subsystem`] Specifies the windows subsystem to link with.
- [`panic_handler`] --- Sets the function to handle panics.
- [`global_allocator`] --- Sets the global memory allocator.
- [`windows_subsystem`] --- Specifies the windows subsystem to link with.
- Features
- `feature` Used to enable unstable or experimental compiler features. See
- `feature` --- Used to enable unstable or experimental compiler features. See
[The Unstable Book] for features implemented in `rustc`.
- Type System
- [`non_exhaustive`] Indicate that a type will have more fields/variants
- [`non_exhaustive`] --- Indicate that a type will have more fields/variants
added in future.
- Debugger
- [`debugger_visualizer`] Embeds a file that specifies debugger output for a type.
- [`collapse_debuginfo`] Controls how macro invocations are encoded in debuginfo.
- [`debugger_visualizer`] --- Embeds a file that specifies debugger output for a type.
- [`collapse_debuginfo`] --- Controls how macro invocations are encoded in debuginfo.

[Doc comments]: comments.md#doc-comments
[ECMA-334]: https://www.ecma-international.org/publications-and-standards/standards/ecma-334/
Expand Down
Loading

0 comments on commit 973632e

Please sign in to comment.