diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aff208478..219695210 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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: | diff --git a/STYLE.md b/STYLE.md index f51cba3d4..977637b08 100644 --- a/STYLE.md +++ b/STYLE.md @@ -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 `` should be placed before the example to explain why it is ignored. diff --git a/book.toml b/book.toml index 9fb3730c8..505e0816d 100644 --- a/book.toml +++ b/book.toml @@ -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" diff --git a/src/attributes.md b/src/attributes.md index 9ce8166db..f3b784d2d 100644 --- a/src/attributes.md +++ b/src/attributes.md @@ -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/ diff --git a/src/attributes/codegen.md b/src/attributes/codegen.md index 195df2f47..e7de84311 100644 --- a/src/attributes/codegen.md +++ b/src/attributes/codegen.md @@ -82,33 +82,33 @@ functions][unsafe function]. Feature | Implicitly Enables | Description ------------|--------------------|------------------- -`adx` | | [ADX] — Multi-Precision Add-Carry Instruction Extensions -`aes` | `sse2` | [AES] — Advanced Encryption Standard -`avx` | `sse4.2` | [AVX] — Advanced Vector Extensions -`avx2` | `avx` | [AVX2] — Advanced Vector Extensions 2 -`bmi1` | | [BMI1] — Bit Manipulation Instruction Sets -`bmi2` | | [BMI2] — Bit Manipulation Instruction Sets 2 -`cmpxchg16b`| | [`cmpxchg16b`] - Compares and exchange 16 bytes (128 bits) of data atomically -`f16c` | `avx` | [F16C] — 16-bit floating point conversion instructions -`fma` | `avx` | [FMA3] — Three-operand fused multiply-add -`fxsr` | | [`fxsave`] and [`fxrstor`] — Save and restore x87 FPU, MMX Technology, and SSE State -`lzcnt` | | [`lzcnt`] — Leading zeros count -`movbe` | | [`movbe`] - Move data after swapping bytes -`pclmulqdq` | `sse2` | [`pclmulqdq`] — Packed carry-less multiplication quadword -`popcnt` | | [`popcnt`] — Count of bits set to 1 -`rdrand` | | [`rdrand`] — Read random number -`rdseed` | | [`rdseed`] — Read random seed -`sha` | `sse2` | [SHA] — Secure Hash Algorithm -`sse` | | [SSE] — Streaming SIMD Extensions -`sse2` | `sse` | [SSE2] — Streaming SIMD Extensions 2 -`sse3` | `sse2` | [SSE3] — Streaming SIMD Extensions 3 -`sse4.1` | `ssse3` | [SSE4.1] — Streaming SIMD Extensions 4.1 -`sse4.2` | `sse4.1` | [SSE4.2] — Streaming SIMD Extensions 4.2 -`ssse3` | `sse3` | [SSSE3] — Supplemental Streaming SIMD Extensions 3 -`xsave` | | [`xsave`] — Save processor extended states -`xsavec` | | [`xsavec`] — Save processor extended states with compaction -`xsaveopt` | | [`xsaveopt`] — Save processor extended states optimized -`xsaves` | | [`xsaves`] — Save processor extended states supervisor +`adx` | | [ADX] --- Multi-Precision Add-Carry Instruction Extensions +`aes` | `sse2` | [AES] --- Advanced Encryption Standard +`avx` | `sse4.2` | [AVX] --- Advanced Vector Extensions +`avx2` | `avx` | [AVX2] --- Advanced Vector Extensions 2 +`bmi1` | | [BMI1] --- Bit Manipulation Instruction Sets +`bmi2` | | [BMI2] --- Bit Manipulation Instruction Sets 2 +`cmpxchg16b`| | [`cmpxchg16b`] --- Compares and exchange 16 bytes (128 bits) of data atomically +`f16c` | `avx` | [F16C] --- 16-bit floating point conversion instructions +`fma` | `avx` | [FMA3] --- Three-operand fused multiply-add +`fxsr` | | [`fxsave`] and [`fxrstor`] --- Save and restore x87 FPU, MMX Technology, and SSE State +`lzcnt` | | [`lzcnt`] --- Leading zeros count +`movbe` | | [`movbe`] --- Move data after swapping bytes +`pclmulqdq` | `sse2` | [`pclmulqdq`] --- Packed carry-less multiplication quadword +`popcnt` | | [`popcnt`] --- Count of bits set to 1 +`rdrand` | | [`rdrand`] --- Read random number +`rdseed` | | [`rdseed`] --- Read random seed +`sha` | `sse2` | [SHA] --- Secure Hash Algorithm +`sse` | | [SSE] --- Streaming SIMD Extensions +`sse2` | `sse` | [SSE2] --- Streaming SIMD Extensions 2 +`sse3` | `sse2` | [SSE3] --- Streaming SIMD Extensions 3 +`sse4.1` | `ssse3` | [SSE4.1] --- Streaming SIMD Extensions 4.1 +`sse4.2` | `sse4.1` | [SSE4.2] --- Streaming SIMD Extensions 4.2 +`ssse3` | `sse3` | [SSSE3] --- Supplemental Streaming SIMD Extensions 3 +`xsave` | | [`xsave`] --- Save processor extended states +`xsavec` | | [`xsavec`] --- Save processor extended states with compaction +`xsaveopt` | | [`xsaveopt`] --- Save processor extended states optimized +`xsaves` | | [`xsaves`] --- Save processor extended states supervisor @@ -159,50 +159,50 @@ Reference Manual], or elsewhere on [developer.arm.com]. Feature | Implicitly Enables | Feature Name ---------------|--------------------|------------------- -`aes` | `neon` | FEAT_AES & FEAT_PMULL - Advanced SIMD AES & PMULL instructions -`bf16` | | FEAT_BF16 - BFloat16 instructions -`bti` | | FEAT_BTI - Branch Target Identification -`crc` | | FEAT_CRC - CRC32 checksum instructions -`dit` | | FEAT_DIT - Data Independent Timing instructions -`dotprod` | | FEAT_DotProd - Advanced SIMD Int8 dot product instructions -`dpb` | | FEAT_DPB - Data cache clean to point of persistence -`dpb2` | | FEAT_DPB2 - Data cache clean to point of deep persistence -`f32mm` | `sve` | FEAT_F32MM - SVE single-precision FP matrix multiply instruction -`f64mm` | `sve` | FEAT_F64MM - SVE double-precision FP matrix multiply instruction -`fcma` | `neon` | FEAT_FCMA - Floating point complex number support -`fhm` | `fp16` | FEAT_FHM - Half-precision FP FMLAL instructions -`flagm` | | FEAT_FlagM - Conditional flag manipulation -`fp16` | `neon` | FEAT_FP16 - Half-precision FP data processing -`frintts` | | FEAT_FRINTTS - Floating-point to int helper instructions -`i8mm` | | FEAT_I8MM - Int8 Matrix Multiplication -`jsconv` | `neon` | FEAT_JSCVT - JavaScript conversion instruction -`lse` | | FEAT_LSE - Large System Extension -`lor` | | FEAT_LOR - Limited Ordering Regions extension -`mte` | | FEAT_MTE & FEAT_MTE2 - Memory Tagging Extension -`neon` | | FEAT_FP & FEAT_AdvSIMD - Floating Point and Advanced SIMD extension -`pan` | | FEAT_PAN - Privileged Access-Never extension -`paca` | | FEAT_PAuth - Pointer Authentication (address authentication) -`pacg` | | FEAT_PAuth - Pointer Authentication (generic authentication) -`pmuv3` | | FEAT_PMUv3 - Performance Monitors extension (v3) -`rand` | | FEAT_RNG - Random Number Generator -`ras` | | FEAT_RAS & FEAT_RASv1p1 - Reliability, Availability and Serviceability extension -`rcpc` | | FEAT_LRCPC - Release consistent Processor Consistent -`rcpc2` | `rcpc` | FEAT_LRCPC2 - RcPc with immediate offsets -`rdm` | | FEAT_RDM - Rounding Double Multiply accumulate -`sb` | | FEAT_SB - Speculation Barrier -`sha2` | `neon` | FEAT_SHA1 & FEAT_SHA256 - Advanced SIMD SHA instructions -`sha3` | `sha2` | FEAT_SHA512 & FEAT_SHA3 - Advanced SIMD SHA instructions -`sm4` | `neon` | FEAT_SM3 & FEAT_SM4 - Advanced SIMD SM3/4 instructions -`spe` | | FEAT_SPE - Statistical Profiling Extension -`ssbs` | | FEAT_SSBS & FEAT_SSBS2 - Speculative Store Bypass Safe -`sve` | `fp16` | FEAT_SVE - Scalable Vector Extension -`sve2` | `sve` | FEAT_SVE2 - Scalable Vector Extension 2 -`sve2-aes` | `sve2`, `aes` | FEAT_SVE_AES - SVE AES instructions -`sve2-sm4` | `sve2`, `sm4` | FEAT_SVE_SM4 - SVE SM4 instructions -`sve2-sha3` | `sve2`, `sha3` | FEAT_SVE_SHA3 - SVE SHA3 instructions -`sve2-bitperm` | `sve2` | FEAT_SVE_BitPerm - SVE Bit Permute -`tme` | | FEAT_TME - Transactional Memory Extension -`vh` | | FEAT_VHE - Virtualization Host Extensions +`aes` | `neon` | FEAT_AES & FEAT_PMULL --- Advanced SIMD AES & PMULL instructions +`bf16` | | FEAT_BF16 --- BFloat16 instructions +`bti` | | FEAT_BTI --- Branch Target Identification +`crc` | | FEAT_CRC --- CRC32 checksum instructions +`dit` | | FEAT_DIT --- Data Independent Timing instructions +`dotprod` | | FEAT_DotProd --- Advanced SIMD Int8 dot product instructions +`dpb` | | FEAT_DPB --- Data cache clean to point of persistence +`dpb2` | | FEAT_DPB2 --- Data cache clean to point of deep persistence +`f32mm` | `sve` | FEAT_F32MM --- SVE single-precision FP matrix multiply instruction +`f64mm` | `sve` | FEAT_F64MM --- SVE double-precision FP matrix multiply instruction +`fcma` | `neon` | FEAT_FCMA --- Floating point complex number support +`fhm` | `fp16` | FEAT_FHM --- Half-precision FP FMLAL instructions +`flagm` | | FEAT_FlagM --- Conditional flag manipulation +`fp16` | `neon` | FEAT_FP16 --- Half-precision FP data processing +`frintts` | | FEAT_FRINTTS --- Floating-point to int helper instructions +`i8mm` | | FEAT_I8MM --- Int8 Matrix Multiplication +`jsconv` | `neon` | FEAT_JSCVT --- JavaScript conversion instruction +`lse` | | FEAT_LSE --- Large System Extension +`lor` | | FEAT_LOR --- Limited Ordering Regions extension +`mte` | | FEAT_MTE & FEAT_MTE2 --- Memory Tagging Extension +`neon` | | FEAT_FP & FEAT_AdvSIMD --- Floating Point and Advanced SIMD extension +`pan` | | FEAT_PAN --- Privileged Access-Never extension +`paca` | | FEAT_PAuth --- Pointer Authentication (address authentication) +`pacg` | | FEAT_PAuth --- Pointer Authentication (generic authentication) +`pmuv3` | | FEAT_PMUv3 --- Performance Monitors extension (v3) +`rand` | | FEAT_RNG --- Random Number Generator +`ras` | | FEAT_RAS & FEAT_RASv1p1 --- Reliability, Availability and Serviceability extension +`rcpc` | | FEAT_LRCPC --- Release consistent Processor Consistent +`rcpc2` | `rcpc` | FEAT_LRCPC2 --- RcPc with immediate offsets +`rdm` | | FEAT_RDM --- Rounding Double Multiply accumulate +`sb` | | FEAT_SB --- Speculation Barrier +`sha2` | `neon` | FEAT_SHA1 & FEAT_SHA256 --- Advanced SIMD SHA instructions +`sha3` | `sha2` | FEAT_SHA512 & FEAT_SHA3 --- Advanced SIMD SHA instructions +`sm4` | `neon` | FEAT_SM3 & FEAT_SM4 --- Advanced SIMD SM3/4 instructions +`spe` | | FEAT_SPE --- Statistical Profiling Extension +`ssbs` | | FEAT_SSBS & FEAT_SSBS2 --- Speculative Store Bypass Safe +`sve` | `fp16` | FEAT_SVE --- Scalable Vector Extension +`sve2` | `sve` | FEAT_SVE2 --- Scalable Vector Extension 2 +`sve2-aes` | `sve2`, `aes` | FEAT_SVE_AES --- SVE AES instructions +`sve2-sm4` | `sve2`, `sm4` | FEAT_SVE_SM4 --- SVE SM4 instructions +`sve2-sha3` | `sve2`, `sha3` | FEAT_SVE_SHA3 --- SVE SHA3 instructions +`sve2-bitperm` | `sve2` | FEAT_SVE_BitPerm --- SVE Bit Permute +`tme` | | FEAT_TME --- Transactional Memory Extension +`vh` | | FEAT_VHE --- Virtualization Host Extensions #### `riscv32` or `riscv64` @@ -218,27 +218,27 @@ in another manual hosted on the [RISC-V GitHub Account]. Feature | Implicitly Enables | Description ------------|---------------------|------------------- -`a` | | [A][rv-a] — Atomic instructions -`c` | | [C][rv-c] — Compressed instructions -`m` | | [M][rv-m] — Integer Multiplication and Division instructions -`zb` | `zba`, `zbc`, `zbs` | [Zb][rv-zb] — Bit Manipulation instructions -`zba` | | [Zba][rv-zb-zba] — Address Generation instructions -`zbb` | | [Zbb][rv-zb-zbb] — Basic bit-manipulation -`zbc` | | [Zbc][rv-zb-zbc] — Carry-less multiplication -`zbkb` | | [Zbkb][rv-zb-zbkb] — Bit Manipulation Instructions for Cryptography -`zbkc` | | [Zbkc][rv-zb-zbc] — Carry-less multiplication for Cryptography -`zbkx` | | [Zbkx][rv-zb-zbkx] — Crossbar permutations -`zbs` | | [Zbs][rv-zb-zbs] — Single-bit instructions -`zk` | `zkn`, `zkr`, `zks`, `zkt`, `zbkb`, `zbkc`, `zkbx` | [Zk][rv-zk] — Scalar Cryptography -`zkn` | `zknd`, `zkne`, `zknh`, `zbkb`, `zbkc`, `zkbx` | [Zkn][rv-zkn] — NIST Algorithm suite extension -`zknd` | | [Zknd][rv-zknd] — NIST Suite: AES Decryption -`zkne` | | [Zkne][rv-zkne] — NIST Suite: AES Encryption -`zknh` | | [Zknh][rv-zknh] — NIST Suite: Hash Function Instructions -`zkr` | | [Zkr][rv-zkr] — Entropy Source Extension -`zks` | `zksed`, `zksh`, `zbkb`, `zbkc`, `zkbx` | [Zks][rv-zks] — ShangMi Algorithm Suite -`zksed` | | [Zksed][rv-zksed] — ShangMi Suite: SM4 Block Cipher Instructions -`zksh` | | [Zksh][rv-zksh] — ShangMi Suite: SM3 Hash Function Instructions -`zkt` | | [Zkt][rv-zkt] — Data Independent Execution Latency Subset +`a` | | [A][rv-a] --- Atomic instructions +`c` | | [C][rv-c] --- Compressed instructions +`m` | | [M][rv-m] --- Integer Multiplication and Division instructions +`zb` | `zba`, `zbc`, `zbs` | [Zb][rv-zb] --- Bit Manipulation instructions +`zba` | | [Zba][rv-zb-zba] --- Address Generation instructions +`zbb` | | [Zbb][rv-zb-zbb] --- Basic bit-manipulation +`zbc` | | [Zbc][rv-zb-zbc] --- Carry-less multiplication +`zbkb` | | [Zbkb][rv-zb-zbkb] --- Bit Manipulation Instructions for Cryptography +`zbkc` | | [Zbkc][rv-zb-zbc] --- Carry-less multiplication for Cryptography +`zbkx` | | [Zbkx][rv-zb-zbkx] --- Crossbar permutations +`zbs` | | [Zbs][rv-zb-zbs] --- Single-bit instructions +`zk` | `zkn`, `zkr`, `zks`, `zkt`, `zbkb`, `zbkc`, `zkbx` | [Zk][rv-zk] --- Scalar Cryptography +`zkn` | `zknd`, `zkne`, `zknh`, `zbkb`, `zbkc`, `zkbx` | [Zkn][rv-zkn] --- NIST Algorithm suite extension +`zknd` | | [Zknd][rv-zknd] --- NIST Suite: AES Decryption +`zkne` | | [Zkne][rv-zkne] --- NIST Suite: AES Encryption +`zknh` | | [Zknh][rv-zknh] --- NIST Suite: Hash Function Instructions +`zkr` | | [Zkr][rv-zkr] --- Entropy Source Extension +`zks` | `zksed`, `zksh`, `zbkb`, `zbkc`, `zkbx` | [Zks][rv-zks] --- ShangMi Algorithm Suite +`zksed` | | [Zksed][rv-zksed] --- ShangMi Suite: SM4 Block Cipher Instructions +`zksh` | | [Zksh][rv-zksh] --- ShangMi Suite: SM3 Hash Function Instructions +`zkt` | | [Zkt][rv-zkt] --- Data Independent Execution Latency Subset @@ -443,8 +443,8 @@ It is a compilation error to use the `instruction_set` attribute on a target tha For the `ARMv4T` and `ARMv5te` architectures, the following are supported: -* `arm::a32` - Generate the function as A32 "ARM" code. -* `arm::t32` - Generate the function as T32 "Thumb" code. +* `arm::a32` --- Generate the function as A32 "ARM" code. +* `arm::t32` --- Generate the function as T32 "Thumb" code. ```rust,ignore diff --git a/src/attributes/debugger.md b/src/attributes/debugger.md index 6d184e87e..21add01ca 100644 --- a/src/attributes/debugger.md +++ b/src/attributes/debugger.md @@ -148,9 +148,9 @@ when generating debuginfo for code calling this macro. The attribute uses the [_MetaListIdents_] syntax to specify its inputs, and can only be applied to macro definitions. Accepted options: -- `#[collapse_debuginfo(yes)]` — code locations in debuginfo are collapsed. -- `#[collapse_debuginfo(no)]` — code locations in debuginfo are not collapsed. -- `#[collapse_debuginfo(external)]` — code locations in debuginfo are collapsed only if the macro comes from a different crate. +- `#[collapse_debuginfo(yes)]` --- code locations in debuginfo are collapsed. +- `#[collapse_debuginfo(no)]` --- code locations in debuginfo are not collapsed. +- `#[collapse_debuginfo(external)]` --- code locations in debuginfo are collapsed only if the macro comes from a different crate. The `external` behavior is the default for macros that don't have this attribute, unless they are built-in macros. For built-in macros the default is `yes`. diff --git a/src/attributes/diagnostics.md b/src/attributes/diagnostics.md index c636a96cc..13baa0b5d 100644 --- a/src/attributes/diagnostics.md +++ b/src/attributes/diagnostics.md @@ -160,14 +160,14 @@ deprecation, including the `since` version and `note`, if available. The `deprecated` attribute has several forms: -- `deprecated` — Issues a generic message. -- `deprecated = "message"` — Includes the given string in the deprecation +- `deprecated` --- Issues a generic message. +- `deprecated = "message"` --- Includes the given string in the deprecation message. - [_MetaListNameValueStr_] syntax with two optional fields: - - `since` — Specifies a version number when the item was deprecated. `rustc` + - `since` --- Specifies a version number when the item was deprecated. `rustc` does not currently interpret the string, but external tools like [Clippy] may check the validity of the value. - - `note` — Specifies a string that should be included in the deprecation + - `note` --- Specifies a string that should be included in the deprecation message. This is typically used to provide an explanation about the deprecation and preferred alternatives. @@ -316,9 +316,9 @@ The attribute should be placed on a [trait declaration], though it is not an err The attribute uses the [_MetaListNameValueStr_] syntax to specify its inputs, though any malformed input to the attribute is not considered as an error to provide both forwards and backwards compatibility. The following keys have the given meaning: -* `message` — The text for the top level error message. -* `label` — The text for the label shown inline in the broken code in the error message. -* `note` — Provides additional notes. +* `message` --- The text for the top level error message. +* `label` --- The text for the label shown inline in the broken code in the error message. +* `note` --- Provides additional notes. The `note` option can appear several times, which results in several note messages being emitted. If any of the other options appears several times the first occurrence of the relevant option specifies the actually used value. @@ -328,8 +328,8 @@ For any other non-existing option a lint-warning is generated. All three options accept a string as an argument, interpreted using the same formatting as a [`std::fmt`] string. Format parameters with the given named parameter will be replaced with the following text: -* `{Self}` — The name of the type implementing the trait. -* `{` *GenericParameterName* `}` — The name of the generic argument's type for the given generic parameter. +* `{Self}` --- The name of the type implementing the trait. +* `{` *GenericParameterName* `}` --- The name of the generic argument's type for the given generic parameter. Any other format parameter will generate a warning, but will otherwise be included in the string as-is. diff --git a/src/inline-assembly.md b/src/inline-assembly.md index 414a36b90..9d505a5d1 100644 --- a/src/inline-assembly.md +++ b/src/inline-assembly.md @@ -515,8 +515,8 @@ To avoid undefined behavior, these rules must be followed when using function-sc ### Correctness and Validity -In addition to all of the previous rules, the string argument to `asm!` must ultimately become— -after all other arguments are evaluated, formatting is performed, and operands are translated— +In addition to all of the previous rules, the string argument to `asm!` must ultimately become--- +after all other arguments are evaluated, formatting is performed, and operands are translated--- assembly that is both syntactically correct and semantically valid for the target architecture. The formatting rules allow the compiler to generate assembly with correct syntax. Rules concerning operands permit valid translation of Rust operands into and out of `asm!`. diff --git a/src/items/extern-crates.md b/src/items/extern-crates.md index d6b3a9aae..bf1c40c38 100644 --- a/src/items/extern-crates.md +++ b/src/items/extern-crates.md @@ -54,7 +54,7 @@ extern crate hello_world; // hyphen replaced with an underscore ## Extern Prelude -This section has been moved to [Preludes — Extern Prelude](../names/preludes.md#extern-prelude). +This section has been moved to [Preludes --- Extern Prelude](../names/preludes.md#extern-prelude). ## Underscore Imports diff --git a/src/items/external-blocks.md b/src/items/external-blocks.md index 697ac2d9e..ca42889b4 100644 --- a/src/items/external-blocks.md +++ b/src/items/external-blocks.md @@ -120,12 +120,12 @@ compiler should link with for the items within an `extern` block. It uses the name of the native library to link. The `kind` key is an optional value which specifies the kind of library with the following possible values: -- `dylib` — Indicates a dynamic library. This is the default if `kind` is not +- `dylib` --- Indicates a dynamic library. This is the default if `kind` is not specified. -- `static` — Indicates a static library. -- `framework` — Indicates a macOS framework. This is only valid for macOS +- `static` --- Indicates a static library. +- `framework` --- Indicates a macOS framework. This is only valid for macOS targets. -- `raw-dylib` — Indicates a dynamic library where the compiler will generate +- `raw-dylib` --- Indicates a dynamic library where the compiler will generate an import library to link against (see [`dylib` versus `raw-dylib`] below for details). This is only valid for Windows targets. diff --git a/src/macros-by-example.md b/src/macros-by-example.md index 014fb852b..69a236d23 100644 --- a/src/macros-by-example.md +++ b/src/macros-by-example.md @@ -165,9 +165,9 @@ identifiers separated by commas. Nested repetitions are permitted. The repetition operators are: -- `*` — indicates any number of repetitions. -- `+` — indicates any number but at least one. -- `?` — indicates an optional fragment with zero or one occurrence. +- `*` --- indicates any number of repetitions. +- `+` --- indicates any number but at least one. +- `?` --- indicates an optional fragment with zero or one occurrence. Since `?` represents at most one occurrence, it cannot be used with a separator. diff --git a/src/names.md b/src/names.md index 46d34459e..44a20ab54 100644 --- a/src/names.md +++ b/src/names.md @@ -6,7 +6,7 @@ the source program, usually via a [path]. Entities include [types], [items], [fields], [attributes], and [lints]. A *declaration* is a syntactical construct that can introduce a *name* to -refer to an entity. Entity names are valid within a [*scope*] — a region of +refer to an entity. Entity names are valid within a [*scope*] --- a region of source text where that name may be referenced. Some entities are [explicitly declared](#explicitly-declared-entities) in the @@ -65,11 +65,11 @@ The following entities are implicitly defined by the language, or are introduced by compiler options and extensions: * [Language prelude]: - * [Boolean type] — `bool` - * [Textual types] — `char` and `str` - * [Integer types] — `i8`, `i16`, `i32`, `i64`, `i128`, `u8`, `u16`, `u32`, `u64`, `u128` - * [Machine-dependent integer types] — `usize` and `isize` - * [floating-point types] — `f32` and `f64` + * [Boolean type] --- `bool` + * [Textual types] --- `char` and `str` + * [Integer types] --- `i8`, `i16`, `i32`, `i64`, `i128`, `u8`, `u16`, `u32`, `u64`, `u128` + * [Machine-dependent integer types] --- `usize` and `isize` + * [floating-point types] --- `f32` and `f64` * [Built-in attributes] * [Standard library prelude] items, attributes, and macros * [Standard library][extern-prelude] crates in the root module diff --git a/src/names/namespaces.md b/src/names/namespaces.md index bb4409b73..36b2e1026 100644 --- a/src/names/namespaces.md +++ b/src/names/namespaces.md @@ -37,7 +37,7 @@ The following is a list of namespaces, with their corresponding entities: * [Generic const parameters] * [Associated const declarations] * [Associated function declarations] - * Local bindings — [`let`], [`if let`], [`while let`], [`for`], [`match`] + * Local bindings --- [`let`], [`if let`], [`while let`], [`for`], [`match`] arms, [function parameters], [closure parameters] * Captured [closure] variables * Macro Namespace diff --git a/src/names/preludes.md b/src/names/preludes.md index 00a112948..f557699e7 100644 --- a/src/names/preludes.md +++ b/src/names/preludes.md @@ -105,11 +105,11 @@ The language prelude includes names of types and attributes that are built-in to the language. The language prelude is always in scope. It includes the following: * [Type namespace] - * [Boolean type] — `bool` - * [Textual types] — `char` and `str` - * [Integer types] — `i8`, `i16`, `i32`, `i64`, `i128`, `u8`, `u16`, `u32`, `u64`, `u128` - * [Machine-dependent integer types] — `usize` and `isize` - * [floating-point types] — `f32` and `f64` + * [Boolean type] --- `bool` + * [Textual types] --- `char` and `str` + * [Integer types] --- `i8`, `i16`, `i32`, `i64`, `i128`, `u8`, `u16`, `u32`, `u64`, `u128` + * [Machine-dependent integer types] --- `usize` and `isize` + * [floating-point types] --- `f32` and `f64` * [Macro namespace] * [Built-in attributes] diff --git a/src/tokens.md b/src/tokens.md index 46c521f28..3b5cef70a 100644 --- a/src/tokens.md +++ b/src/tokens.md @@ -93,7 +93,7 @@ A suffix is a sequence of characters following the primary part of a literal (wi > **Lexer**\ > SUFFIX : IDENTIFIER_OR_KEYWORD\ -> SUFFIX_NO_E : SUFFIX _not beginning with `e` or `E`_ +> SUFFIX_NO_E : SUFFIX _not beginning with `e` or `E`_ Any kind of literal (string, integer, etc) with any suffix is valid as a token. diff --git a/src/types.md b/src/types.md index aed10fd0f..0f8263835 100644 --- a/src/types.md +++ b/src/types.md @@ -12,10 +12,10 @@ limited capabilities. The list of types is: * Primitive types: - * [Boolean] — `bool` - * [Numeric] — integer and float - * [Textual] — `char` and `str` - * [Never] — `!` — a type with no values + * [Boolean] --- `bool` + * [Numeric] --- integer and float + * [Textual] --- `char` and `str` + * [Never] --- `!` --- a type with no values * Sequence types: * [Tuple] * [Array]