Skip to content

Commit 3f14b0b

Browse files
committed
Fix rules being positioned incorrectly respective of their header
Some of these were missed in #1710 or were inadvertently merged after that PR.
1 parent c21d158 commit 3f14b0b

File tree

5 files changed

+7
-14
lines changed

5 files changed

+7
-14
lines changed

Diff for: src/attributes/diagnostics.md

+1-2
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.

Diff for: src/behavior-considered-undefined.md

+3-6
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,10 @@ r[undefined.pointed-to]
100100

101101
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`).
102102

103+
r[undefined.misaligned]
103104
### Places based on misaligned pointers
104105
[based on a misaligned pointer]: #places-based-on-misaligned-pointers
105106

106-
r[undefined.misaligned]
107-
108107
r[undefined.misaligned.general]
109108
A place is said to be "based on a misaligned pointer" if the last `*` projection
110109
during place computation was performed on a pointer that was not aligned for its
@@ -141,11 +140,10 @@ more aligned than the type that contains it, i.e., `repr(packed)`. This means
141140
that being based on an aligned pointer is always sufficient to ensure that the
142141
new reference is aligned, but it is not always necessary.
143142

143+
r[undefined.dangling]
144144
### Dangling pointers
145145
[dangling]: #dangling-pointers
146146

147-
r[undefined.dangling]
148-
149147
r[undefined.dangling.general]
150148
A reference/pointer is "dangling" if not all of the bytes it
151149
[points to] are part of the same live allocation (so in particular they all have to be
@@ -164,11 +162,10 @@ In particular, the dynamic size of a Rust value (as determined by `size_of_val`)
164162
must never exceed `isize::MAX`, since it is impossible for a single allocation
165163
to be larger than `isize::MAX`.
166164

165+
r[undefined.validity]
167166
### Invalid values
168167
[invalid-values]: #invalid-values
169168

170-
r[undefined.validity]
171-
172169
r[undefined.validity.general]
173170
The Rust compiler assumes that all values produced during program execution are
174171
"valid", and producing an invalid value is hence immediate UB.

Diff for: src/const_eval.md

+1-2
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

Diff for: src/dynamically-sized-types.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
# Dynamically Sized Types
2-
31
r[dynamic-sized]
2+
# Dynamically Sized Types
43

54
r[dynamic-sized.intro]
65
Most types have a fixed size that is known at compile time and implement the

Diff for: src/linkage.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,8 @@ a statically linked binary on MSVC you would execute:
251251
RUSTFLAGS='-C target-feature=+crt-static' cargo build --target x86_64-pc-windows-msvc
252252
```
253253

254-
## Mixed Rust and foreign codebases
255-
256254
r[link.foreign-code]
255+
## Mixed Rust and foreign codebases
257256

258257
r[link.foreign-code.foreign-linkers]
259258
If you are mixing Rust with foreign code (e.g. C, C++) and wish to make a single

0 commit comments

Comments
 (0)