Skip to content

Commit f5cffea

Browse files
ehusstraviscross
authored andcommitted
Unwrap all note blocks
This is to follow the style guide (and fix some broken blockquotes).
1 parent 484d3f2 commit f5cffea

34 files changed

+68
-188
lines changed

src/attributes.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,7 @@ pub fn f() {}
228228
```
229229

230230
> [!NOTE]
231-
> `rustc` currently recognizes the tools "clippy", "rustfmt", "diagnostic",
232-
> "miri" and "rust_analyzer".
231+
> `rustc` currently recognizes the tools "clippy", "rustfmt", "diagnostic", "miri" and "rust_analyzer".
233232
234233
r[attributes.builtin]
235234
## Built-in attributes index

src/attributes/codegen.md

+7-21
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ should be placed in the caller, rather than generating code to call the
2727
function where it is defined.
2828

2929
> [!NOTE]
30-
> The `rustc` compiler automatically inlines functions based on
31-
> internal heuristics. Incorrectly inlining functions can make the program
32-
> slower, so this attribute should be used with care.
30+
> The `rustc` compiler automatically inlines functions based on internal heuristics. Incorrectly inlining functions can make the program slower, so this attribute should be used with care.
3331
3432
r[attributes.codegen.inline.modes]
3533
There are three ways to use the inline attribute:
@@ -41,8 +39,7 @@ There are three ways to use the inline attribute:
4139
performed.
4240

4341
> [!NOTE]
44-
> `#[inline]` in every form is a hint, with no *requirements*
45-
> on the language to place a copy of the attributed function in the caller.
42+
> `#[inline]` in every form is a hint, with no *requirements* on the language to place a copy of the attributed function in the caller.
4643
4744
r[attributes.codegen.cold]
4845
### The `cold` attribute
@@ -232,8 +229,7 @@ Reference Manual], or elsewhere on [developer.arm.com].
232229
[developer.arm.com]: https://developer.arm.com
233230

234231
> [!NOTE]
235-
> The following pairs of features should both be marked as enabled
236-
> or disabled together if used:
232+
> The following pairs of features should both be marked as enabled or disabled together if used:
237233
> - `paca` and `pacg`, which LLVM currently implements as one feature.
238234
239235

@@ -394,10 +390,7 @@ See the [`is_x86_feature_detected`] or [`is_aarch64_feature_detected`] macros
394390
in the standard library for runtime feature detection on these platforms.
395391

396392
> [!NOTE]
397-
> `rustc` has a default set of features enabled for each target and CPU.
398-
> The CPU may be chosen with the [`-C target-cpu`] flag. Individual features
399-
> may be enabled or disabled for an entire crate with the
400-
> [`-C target-feature`] flag.
393+
> `rustc` has a default set of features enabled for each target and CPU. The CPU may be chosen with the [`-C target-cpu`] flag. Individual features may be enabled or disabled for an entire crate with the [`-C target-feature`] flag.
401394
402395
r[attributes.codegen.track_caller]
403396
## The `track_caller` attribute
@@ -432,12 +425,10 @@ fn f() {
432425
```
433426

434427
> [!NOTE]
435-
> `core` provides [`core::panic::Location::caller`] for observing caller locations. It wraps
436-
> the [`core::intrinsics::caller_location`] intrinsic implemented by `rustc`.
428+
> `core` provides [`core::panic::Location::caller`] for observing caller locations. It wraps the [`core::intrinsics::caller_location`] intrinsic implemented by `rustc`.
437429
438430
> [!NOTE]
439-
> Because the resulting `Location` is a hint, an implementation may halt its walk up the stack
440-
> early. See [Limitations](#limitations) for important caveats.
431+
> Because the resulting `Location` is a hint, an implementation may halt its walk up the stack early. See [Limitations](#limitations) for important caveats.
441432
442433
#### Examples
443434

@@ -511,12 +502,7 @@ caller information across virtual calls. A common example of this coercion is th
511502
trait object whose methods are attributed.
512503

513504
> [!NOTE]
514-
> The aforementioned shim for function pointers is necessary because `rustc` implements
515-
> `track_caller` in a codegen context by appending an implicit parameter to the function ABI, but
516-
> this would be unsound for an indirect call because the parameter is not a part of the function's
517-
> type and a given function pointer type may or may not refer to a function with the attribute. The
518-
> creation of a shim hides the implicit parameter from callers of the function pointer, preserving
519-
> soundness.
505+
> The aforementioned shim for function pointers is necessary because `rustc` implements `track_caller` in a codegen context by appending an implicit parameter to the function ABI, but this would be unsound for an indirect call because the parameter is not a part of the function's type and a given function pointer type may or may not refer to a function with the attribute. The creation of a shim hides the implicit parameter from callers of the function pointer, preserving soundness.
520506
521507
[_MetaListNameValueStr_]: ../attributes.md#meta-item-attribute-syntax
522508
[`-C target-cpu`]: ../../rustc/codegen-options/index.html#target-cpu

src/attributes/diagnostics.md

+5-13
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ r[attributes.diagnostics.lint.forbid]
3838
level afterwards,
3939

4040
> [!NOTE]
41-
> The lint checks supported by `rustc` can be found via `rustc -W help`,
42-
> along with their default settings and are documented in the [rustc book].
41+
> The lint checks supported by `rustc` can be found via `rustc -W help`, along with their default settings and are documented in the [rustc book].
4342
4443
```rust
4544
pub mod m1 {
@@ -100,9 +99,7 @@ pub mod m3 {
10099
```
101100

102101
> [!NOTE]
103-
> `rustc` allows setting lint levels on the
104-
> [command-line][rustc-lint-cli], and also supports [setting
105-
> caps][rustc-lint-caps] on the lints that are reported.
102+
> `rustc` allows setting lint levels on the [command-line][rustc-lint-cli], and also supports [setting caps][rustc-lint-caps] on the lints that are reported.
106103
107104
r[attributes.diagnostics.lint.reason]
108105
### Lint Reasons
@@ -225,8 +222,7 @@ pub fn another_example() {
225222
```
226223

227224
> [!NOTE]
228-
> The behavior of `#[expect(unfulfilled_lint_expectations)]` is currently
229-
> defined to always generate the `unfulfilled_lint_expectations` lint.
225+
> The behavior of `#[expect(unfulfilled_lint_expectations)]` is currently defined to always generate the `unfulfilled_lint_expectations` lint.
230226
231227
r[attributes.diagnostics.lint.group]
232228
### Lint groups
@@ -438,10 +434,7 @@ r[attributes.diagnostics.must_use.trait-impl-function]
438434
When used on a function in a trait implementation, the attribute does nothing.
439435

440436
> [!NOTE]
441-
> Trivial no-op expressions containing the value will not violate the
442-
> lint. Examples include wrapping the value in a type that does not implement
443-
> [`Drop`] and then not using that type and being the final expression of a
444-
> [block expression] that is not used.
437+
> Trivial no-op expressions containing the value will not violate the lint. Examples include wrapping the value in a type that does not implement [`Drop`] and then not using that type and being the final expression of a [block expression] that is not used.
445438
>
446439
> ```rust
447440
> #[must_use]
@@ -458,8 +451,7 @@ When used on a function in a trait implementation, the attribute does nothing.
458451
> ```
459452
460453
> [!NOTE]
461-
> It is idiomatic to use a [let statement] with a pattern of `_`
462-
> when a must-used value is purposely discarded.
454+
> It is idiomatic to use a [let statement] with a pattern of `_` when a must-used value is purposely discarded.
463455
>
464456
> ```rust
465457
> #[must_use]

src/attributes/testing.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ Test functions must be free, monomorphic functions that take no arguments, and t
2727
onwards, also update it in the crates-and-source-files.md file -->
2828

2929
> [!NOTE]
30-
> The test mode is enabled by passing the `--test` argument to `rustc`
31-
> or using `cargo test`.
30+
> The test mode is enabled by passing the `--test` argument to `rustc` or using `cargo test`.
3231
3332
r[attributes.testing.test.success]
3433
The test harness calls the returned value's [`report`] method, and classifies the test as passed or failed depending on whether the resulting [`ExitCode`] represents successful termination.
@@ -71,8 +70,7 @@ fn mytest() {
7170
```
7271

7372
> [!NOTE]
74-
> The `rustc` test harness supports the `--include-ignored` flag to
75-
> force ignored tests to be run.
73+
> The `rustc` test harness supports the `--include-ignored` flag to force ignored tests to be run.
7674
7775
r[attributes.testing.should_panic]
7876
## The `should_panic` attribute

src/behavior-considered-undefined.md

+2-7
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,7 @@ r[undefined.runtime]
102102
* The runtime assumes that a Rust stack frame is not deallocated without executing destructors for local variables owned by the stack frame. This assumption can be violated by C functions like `longjmp`.
103103

104104
> [!NOTE]
105-
> Undefined behavior affects the entire program. For example, calling
106-
> a function in C that exhibits undefined behavior of C means your entire
107-
> program contains undefined behaviour that can also affect the Rust code. And
108-
> vice versa, undefined behavior in Rust can cause adverse affects on code
109-
> executed by any FFI calls to other languages.
105+
> Undefined behavior affects the entire program. For example, calling a function in C that exhibits undefined behavior of C means your entire program contains undefined behaviour that can also affect the Rust code. And vice versa, undefined behavior in Rust can cause adverse affects on code executed by any FFI calls to other languages.
110106
111107
r[undefined.pointed-to]
112108
### Pointed-to bytes
@@ -239,8 +235,7 @@ r[undefined.validity.valid-range]
239235
In the standard library, this affects [`NonNull<T>`] and [`NonZero<T>`].
240236

241237
> [!NOTE]
242-
> `rustc` achieves this with the unstable
243-
> `rustc_layout_scalar_valid_range_*` attributes.
238+
> `rustc` achieves this with the unstable `rustc_layout_scalar_valid_range_*` attributes.
244239
245240
r[undefined.validity.undef]
246241
**Note:** Uninitialized memory is also implicitly invalid for any type that has

src/comments.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,7 @@ r[comments.doc.bare-crs]
7272
The character `U+000D` (CR) is not allowed in doc comments.
7373

7474
> [!NOTE]
75-
> It is conventional for doc comments to contain Markdown, as expected by
76-
> `rustdoc`. However, the comment syntax does not respect any internal Markdown.
77-
> ``/** `glob = "*/*.rs";` */`` terminates the comment at the first `*/`, and the
78-
> remaining code would cause a syntax error. This slightly limits the content of
79-
> block doc comments compared to line doc comments.
75+
> It is conventional for doc comments to contain Markdown, as expected by `rustdoc`. However, the comment syntax does not respect any internal Markdown. ``/** `glob = "*/*.rs";` */`` terminates the comment at the first `*/`, and the remaining code would cause a syntax error. This slightly limits the content of block doc comments compared to line doc comments.
8076
8177
> [!NOTE]
8278
> The sequence `U+000D` (CR) immediately followed by `U+000A` (LF) would have been previously transformed into a single `U+000A` (LF).

src/conditional-compilation.md

+3-9
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,10 @@ It is not possible to set a
8282
configuration option from within the source code of the crate being compiled.
8383

8484
> [!NOTE]
85-
> For `rustc`, arbitrary-set configuration options are set using the
86-
> [`--cfg`] flag. Configuration values for a specified target can be displayed with `rustc --print cfg --target $TARGET`.
85+
> For `rustc`, arbitrary-set configuration options are set using the [`--cfg`] flag. Configuration values for a specified target can be displayed with `rustc --print cfg --target $TARGET`.
8786
8887
> [!NOTE]
89-
> Configuration options with the key `feature` are a convention used
90-
> by [Cargo][cargo-feature] for specifying compile-time options and optional
91-
> dependencies.
88+
> Configuration options with the key `feature` are a convention used by [Cargo][cargo-feature] for specifying compile-time options and optional dependencies.
9289
9390
r[cfg.target_arch]
9491
### `target_arch`
@@ -426,10 +423,7 @@ fn bewitched() {}
426423
```
427424

428425
> [!NOTE]
429-
> The `cfg_attr` can expand to another `cfg_attr`. For example,
430-
> `#[cfg_attr(target_os = "linux", cfg_attr(feature = "multithreaded", some_other_attribute))]`
431-
> is valid. This example would be equivalent to
432-
> `#[cfg_attr(all(target_os = "linux", feature ="multithreaded"), some_other_attribute)]`.
426+
> The `cfg_attr` can expand to another `cfg_attr`. For example, `#[cfg_attr(target_os = "linux", cfg_attr(feature = "multithreaded", some_other_attribute))]` is valid. This example would be equivalent to `#[cfg_attr(all(target_os = "linux", feature ="multithreaded"), some_other_attribute)]`.
433427
434428
r[cfg.cfg_attr.restriction]
435429
The `cfg_attr` attribute is allowed anywhere attributes are allowed.

src/crates-and-source-files.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ r[crate.syntax]
88
> &nbsp;&nbsp; [_Item_]<sup>\*</sup>
99
1010
> [!NOTE]
11-
> Although Rust, like any other language, can be implemented by an
12-
> interpreter as well as a compiler, the only existing implementation is a
13-
> compiler, and the language has always been designed to be compiled. For these
14-
> reasons, this section assumes a compiler.
11+
> Although Rust, like any other language, can be implemented by an interpreter as well as a compiler, the only existing implementation is a compiler, and the language has always been designed to be compiled. For these reasons, this section assumes a compiler.
1512
1613
r[crate.compile-time]
1714
Rust's semantics obey a *phase distinction* between compile-time and

src/destructors.md

+3-8
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,7 @@ smallest scope that contains the expression and is one of the following:
212212
* The entirety of the tail expression of a block ([destructors.scope.temporary.edition2024]).
213213

214214
> [!NOTE]
215-
> The [scrutinee] of a `match` expression is not a temporary scope, so
216-
> temporaries in the scrutinee can be dropped after the `match` expression. For
217-
> example, the temporary for `1` in `match 1 { ref mut z => z };` lives until
218-
> the end of the statement.
215+
> The [scrutinee] of a `match` expression is not a temporary scope, so temporaries in the scrutinee can be dropped after the `match` expression. For example, the temporary for `1` in `match 1 { ref mut z => z };` lives until the end of the statement.
219216
220217
r[destructors.scope.temporary.edition2024]
221218
> **Edition differences**: The 2024 edition added two new temporary scope narrowing rules: `if let` temporaries are dropped before the `else` block, and temporaries of tail expressions of blocks are dropped immediately after the tail expression is evaluated.
@@ -315,8 +312,7 @@ r[destructors.scope.lifetime-extension]
315312

316313

317314
> [!NOTE]
318-
> The exact rules for temporary lifetime extension are subject to
319-
> change. This is describing the current behavior only.
315+
> The exact rules for temporary lifetime extension are subject to change. This is describing the current behavior only.
320316
321317
r[destructors.scope.lifetime-extension.let]
322318
The temporary scopes for expressions in `let` statements are sometimes
@@ -433,8 +429,7 @@ and [`std::mem::ManuallyDrop`] provides a wrapper to prevent a
433429
variable or field from being dropped automatically.
434430

435431
> [!NOTE]
436-
> Preventing a destructor from being run via [`std::mem::forget`] or other means is safe even if it has a type that isn't `'static`.
437-
> Besides the places where destructors are guaranteed to run as defined by this document, types may *not* safely rely on a destructor being run for soundness.
432+
> Preventing a destructor from being run via [`std::mem::forget`] or other means is safe even if it has a type that isn't `'static`. Besides the places where destructors are guaranteed to run as defined by this document, types may *not* safely rely on a destructor being run for soundness.
438433
439434
r[destructors.process-termination]
440435
### Process termination without unwinding

src/dynamically-sized-types.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ r[dynamic-sized.struct-field]
3535
<abbr title="dynamically sized type">DST</abbr>.
3636

3737
> [!NOTE]
38-
> [Variables], function parameters, [const] items, and [static] items must be
39-
`Sized`.
38+
> [Variables], function parameters, [const] items, and [static] items must be `Sized`.
4039
4140
[sized]: special-types-and-traits.md#sized
4241
[Slices]: types/slice.md

src/expressions.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,7 @@ The operands of these expressions are evaluated prior to applying the effects of
128128
Expressions taking multiple operands are evaluated left to right as written in the source code.
129129

130130
> [!NOTE]
131-
> Which subexpressions are the operands of an expression is
132-
> determined by expression precedence as per the previous section.
131+
> Which subexpressions are the operands of an expression is determined by expression precedence as per the previous section.
133132
134133
For example, the two `next` method calls will always be called in the same order:
135134

src/expressions/block-expr.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ r[expr.block.value]
6666
Blocks are always [value expressions] and evaluate the last operand in value expression context.
6767

6868
> [!NOTE]
69-
> This can be used to force moving a value if really needed.
70-
> For example, the following example fails on the call to `consume_self` because the struct was moved out of `s` in the block expression.
69+
> This can be used to force moving a value if really needed. For example, the following example fails on the call to `consume_self` because the struct was moved out of `s` in the block expression.
7170
>
7271
> ```rust,compile_fail
7372
> struct Struct;

src/expressions/call-expr.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ r[expr.call.desugar.ambiguity]
4545
Function calls may need to be fully qualified, depending on the ambiguity of a call in light of in-scope items.
4646

4747
> [!NOTE]
48-
> In the past, the terms "Unambiguous Function Call Syntax", "Universal Function Call Syntax", or "UFCS", have been used in documentation, issues, RFCs, and other community writings.
49-
> However, these terms lack descriptive power and potentially confuse the issue at hand.
50-
> We mention them here for searchability's sake.
48+
> In the past, the terms "Unambiguous Function Call Syntax", "Universal Function Call Syntax", or "UFCS", have been used in documentation, issues, RFCs, and other community writings. However, these terms lack descriptive power and potentially confuse the issue at hand. We mention them here for searchability's sake.
5149
5250
r[expr.call.desugar.limits]
5351
Several situations often occur which result in ambiguities about the receiver or referent of method or associated function calls.

0 commit comments

Comments
 (0)