Skip to content

Commit 96618fa

Browse files
authored
Merge pull request #1770 from ehuss/fix-header-rules
Fix header rules
2 parents 3842281 + 3678a65 commit 96618fa

27 files changed

+7
-72
lines changed

src/attributes/codegen.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
r[attributes.codegen]
22
# Code generation attributes
33

4-
54
The following [attributes] are used for controlling code generation.
65

76
r[attributes.codegen.hint]
@@ -44,14 +43,12 @@ There are three ways to use the inline attribute:
4443
r[attributes.codegen.cold]
4544
### The `cold` attribute
4645

47-
4846
The *`cold` [attribute]* suggests that the attributed function is unlikely to
4947
be called.
5048

5149
r[attributes.codegen.no_builtins]
5250
## The `no_builtins` attribute
5351

54-
5552
The *`no_builtins` [attribute]* may be applied at the crate level to disable
5653
optimizing certain code patterns to invocations of library functions that are
5754
assumed to exist.
@@ -143,13 +140,11 @@ be used with a `target_feature` attribute.
143140
r[attributes.codegen.target_feature.availability]
144141
### Available features
145142

146-
147143
The following is a list of the available feature names.
148144

149145
r[attributes.codegen.target_feature.x86]
150146
#### `x86` or `x86_64`
151147

152-
153148
Executing code with unsupported features is undefined behavior on this platform.
154149
Hence on this platform usage of `#[target_feature]` functions follows the
155150
[above restrictions][attributes.codegen.target_feature.safety-restrictions].
@@ -218,7 +213,6 @@ Feature | Implicitly Enables | Description
218213
r[attributes.codegen.target_feature.aarch64]
219214
#### `aarch64`
220215

221-
222216
On this platform the usage of `#[target_feature]` functions follows the
223217
[above restrictions][attributes.codegen.target_feature.safety-restrictions].
224218

@@ -232,7 +226,6 @@ Reference Manual], or elsewhere on [developer.arm.com].
232226
> The following pairs of features should both be marked as enabled or disabled together if used:
233227
> - `paca` and `pacg`, which LLVM currently implements as one feature.
234228
235-
236229
Feature | Implicitly Enables | Feature Name
237230
---------------|--------------------|-------------------
238231
`aes` | `neon` | FEAT_AES & FEAT_PMULL --- Advanced <abbr title="Single Instruction Multiple Data">SIMD</abbr> AES & PMULL instructions
@@ -283,7 +276,6 @@ Feature | Implicitly Enables | Feature Name
283276
r[attributes.codegen.target_feature.riscv]
284277
#### `riscv32` or `riscv64`
285278

286-
287279
On this platform the usage of `#[target_feature]` functions follows the
288280
[above restrictions][attributes.codegen.target_feature.safety-restrictions].
289281

@@ -345,7 +337,6 @@ Feature | Implicitly Enables | Description
345337
r[attributes.codegen.target_feature.wasm]
346338
#### `wasm32` or `wasm64`
347339

348-
349340
Safe `#[target_feature]` functions may always be used in safe contexts on Wasm
350341
platforms. It is impossible to cause undefined behavior via the
351342
`#[target_feature]` attribute because attempting to use instructions
@@ -539,7 +530,6 @@ It is a compilation error to use the `instruction_set` attribute on a target tha
539530
r[attributes.codegen.instruction_set.arm]
540531
### On ARM
541532

542-
543533
For the `ARMv4T` and `ARMv5te` architectures, the following are supported:
544534
* `arm::a32` --- Generate the function as A32 "ARM" code.
545535
* `arm::t32` --- Generate the function as T32 "Thumb" code.

src/attributes/debugger.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
r[attributes.debugger]
22
# Debugger attributes
33

4-
54
The following [attributes] are used for enhancing the debugging experience when using third-party debuggers like GDB or WinDbg.
65

76
r[attributes.debugger.debugger_visualizer]

src/attributes/diagnostics.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,9 +549,8 @@ error[E0277]: My Message for `ImportantTrait<i32>` implemented for `String`
549549
= note: Note 2
550550
```
551551

552-
### The `diagnostic::do_not_recommend` attribute
553-
554552
r[attributes.diagnostic.do_not_recommend]
553+
### The `diagnostic::do_not_recommend` attribute
555554

556555
r[attributes.diagnostic.do_not_recommend.intro]
557556
The `#[diagnostic::do_not_recommend]` attribute is a hint to the compiler to not show the annotated trait implementation as part of a diagnostic message.

src/attributes/limits.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
r[attributes.limits]
22
# Limits
33

4-
54
The following [attributes] affect compile-time limits.
65

76
r[attributes.limits.recursion_limit]
@@ -44,7 +43,6 @@ a!{}
4443
r[attributes.limits.type_length_limit]
4544
## The `type_length_limit` attribute
4645

47-
4846
> [!NOTE]
4947
> This limit is only enforced when the nightly `-Zenforce-type-length-limit` flag is active.
5048
>

src/attributes/testing.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
r[attributes.testing]
22
# Testing attributes
33

4-
54
The following [attributes] are used for specifying functions for performing
65
tests. Compiling a crate in "test" mode enables building the test functions
76
along with a test harness for executing the tests. Enabling the test mode also

src/behavior-considered-undefined.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,10 @@ r[undefined.pointed-to]
9696

9797
The span of bytes a pointer or reference "points to" is determined by the pointer value and the size of the pointee type (using `size_of_val`).
9898

99+
r[undefined.misaligned]
99100
### Places based on misaligned pointers
100101
[based on a misaligned pointer]: #places-based-on-misaligned-pointers
101102

102-
r[undefined.misaligned]
103-
104103
r[undefined.misaligned.general]
105104
A place is said to be "based on a misaligned pointer" if the last `*` projection
106105
during place computation was performed on a pointer that was not aligned for its
@@ -137,11 +136,10 @@ more aligned than the type that contains it, i.e., `repr(packed)`. This means
137136
that being based on an aligned pointer is always sufficient to ensure that the
138137
new reference is aligned, but it is not always necessary.
139138

139+
r[undefined.dangling]
140140
### Dangling pointers
141141
[dangling]: #dangling-pointers
142142

143-
r[undefined.dangling]
144-
145143
r[undefined.dangling.general]
146144
A reference/pointer is "dangling" if not all of the bytes it
147145
[points to] are part of the same live allocation (so in particular they all have to be
@@ -160,11 +158,10 @@ In particular, the dynamic size of a Rust value (as determined by `size_of_val`)
160158
must never exceed `isize::MAX`, since it is impossible for a single allocation
161159
to be larger than `isize::MAX`.
162160

161+
r[undefined.validity]
163162
### Invalid values
164163
[invalid-values]: #invalid-values
165164

166-
r[undefined.validity]
167-
168165
r[undefined.validity.general]
169166
The Rust compiler assumes that all values produced during program execution are
170167
"valid", and producing an invalid value is hence immediate UB.

src/comments.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
r[comments.syntax]
22
# Comments
33

4-
54
> **<sup>Lexer</sup>**\
65
> LINE_COMMENT :\
76
> &nbsp;&nbsp; &nbsp;&nbsp; `//` (~\[`/` `!` `\n`] | `//`) ~`\n`<sup>\*</sup>\
@@ -37,7 +36,6 @@ r[comments.syntax]
3736
r[comments.normal]
3837
## Non-doc comments
3938

40-
4139
Comments follow the general C++ style of line (`//`) and
4240
block (`/* ... */`) comment forms. Nested block comments are supported.
4341

src/conditional-compilation.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ r[cfg.target_has_atomic.stdlib]
263263
When this cfg is present, all of the stable [`core::sync::atomic`] APIs are available for
264264
the relevant atomic width.
265265

266-
267266
r[cfg.target_has_atomic.values]
268267
Possible values:
269268

@@ -277,14 +276,12 @@ Possible values:
277276
r[cfg.test]
278277
### `test`
279278

280-
281279
Enabled when compiling the test harness. Done with `rustc` by using the
282280
[`--test`] flag. See [Testing] for more on testing support.
283281

284282
r[cfg.debug_assertions]
285283
### `debug_assertions`
286284

287-
288285
Enabled by default when compiling without optimizations.
289286
This can be used to enable extra debugging code in development but not in
290287
production. For example, it controls the behavior of the standard library's
@@ -293,7 +290,6 @@ production. For example, it controls the behavior of the standard library's
293290
r[cfg.proc_macro]
294291
### `proc_macro`
295292

296-
297293
Set when the crate being compiled is being compiled with the `proc_macro`
298294
[crate type].
299295

src/const_eval.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,10 @@ r[const-eval.const-expr.loop]
107107
r[const-eval.const-expr.if-match]
108108
* [if], [`if let`] and [match] expressions.
109109

110+
r[const-eval.const-context]
110111
## Const context
111112
[const context]: #const-context
112113

113-
r[const-eval.const-context]
114-
115114
r[const-eval.const-context.general]
116115
A _const context_ is one of the following:
117116

src/destructors.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ r[destructors.scope.nesting.other]
136136
r[destructors.scope.params]
137137
### Scopes of function parameters
138138

139-
140139
All function parameters are in the scope of the entire function body, so are
141140
dropped last when evaluating the function. Each actual function parameter is
142141
dropped after any bindings introduced in that parameter's pattern.
@@ -266,7 +265,6 @@ match PrintOnDrop("Matched value in final expression") {
266265
r[destructors.scope.operands]
267266
### Operands
268267

269-
270268
Temporaries are also created to hold the result of operands to an expression
271269
while the other operands are evaluated. The temporaries are associated to the
272270
scope of the expression with that operand. Since the temporaries are moved from
@@ -298,7 +296,6 @@ loop {
298296
r[destructors.scope.const-promotion]
299297
### Constant promotion
300298

301-
302299
Promotion of a value expression to a `'static` slot occurs when the expression
303300
could be written in a constant and borrowed, and that borrow could be dereferenced
304301
where
@@ -311,7 +308,6 @@ always has the type `&'static Option<_>`, as it contains nothing disallowed).
311308
r[destructors.scope.lifetime-extension]
312309
### Temporary lifetime extension
313310

314-
315311
> [!NOTE]
316312
> The exact rules for temporary lifetime extension are subject to change. This is describing the current behavior only.
317313
@@ -368,7 +364,6 @@ scope of the initializer expression is extended.
368364
r[destructors.scope.lifetime-extension.exprs]
369365
#### Extending based on expressions
370366

371-
372367
For a let statement with an initializer, an *extending expression* is an
373368
expression which is one of the following:
374369

0 commit comments

Comments
 (0)