Skip to content

Commit 9d40c46

Browse files
committed
De-wrap warning blocks
1 parent de2c4a1 commit 9d40c46

File tree

5 files changed

+6
-27
lines changed

5 files changed

+6
-27
lines changed

src/behavior-considered-undefined.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,7 @@ undefined behavior, it is *unsound*.
1414

1515
<div class="warning">
1616

17-
***Warning:*** The following list is not exhaustive; it may grow or shrink.
18-
There is no formal model of Rust's semantics for what is and is not allowed in
19-
unsafe code, so there may be more behavior considered unsafe. We also reserve
20-
the right to make some of the behavior in that list defined in the future. In
21-
other words, this list does not say that anything will *definitely* always be
22-
undefined in all future Rust version (but we might make such commitments for
23-
some list items in the future).
17+
***Warning:*** The following list is not exhaustive; it may grow or shrink. There is no formal model of Rust's semantics for what is and is not allowed in unsafe code, so there may be more behavior considered unsafe. We also reserve the right to make some of the behavior in that list defined in the future. In other words, this list does not say that anything will *definitely* always be undefined in all future Rust version (but we might make such commitments for some list items in the future).
2418

2519
Please read the [Rustonomicon] before writing unsafe code.
2620

src/items/external-blocks.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,7 @@ that symbol rather than having to look it up by name.
294294

295295
<div class="warning">
296296

297-
Warning: `link_ordinal` should only be used in cases where the ordinal of the
298-
symbol is known to be stable: if the ordinal of a symbol is not explicitly set
299-
when its containing binary is built then one will be automatically assigned to
300-
it, and that assigned ordinal may change between builds of the binary.
297+
Warning: `link_ordinal` should only be used in cases where the ordinal of the symbol is known to be stable: if the ordinal of a symbol is not explicitly set when its containing binary is built then one will be automatically assigned to it, and that assigned ordinal may change between builds of the binary.
301298

302299
</div>
303300

src/names/preludes.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,7 @@ The *`no_std` [attribute]* may be applied at the crate level to prevent the
9393
9494
<div class="warning">
9595
96-
Warning: Using `no_std` does not prevent the standard library from being
97-
linked in. It is still valid to put `extern crate std;` into the crate and
98-
dependencies can also link it in.
96+
Warning: Using `no_std` does not prevent the standard library from being linked in. It is still valid to put `extern crate std;` into the crate and dependencies can also link it in.
9997
10098
</div>
10199

src/patterns.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,7 @@ Since negative numbers are not [literals], literal patterns also accept an optio
144144

145145
<div class="warning">
146146

147-
C string and raw C string literals are accepted in literal patterns, but `&CStr`
148-
doesn't implement structural equality (`#[derive(Eq, PartialEq)]`) and therefore
149-
any such `match` on a `&CStr` will be rejected with a type error.
147+
C string and raw C string literals are accepted in literal patterns, but `&CStr` doesn't implement structural equality (`#[derive(Eq, PartialEq)]`) and therefore any such `match` on a `&CStr` will be rejected with a type error.
150148

151149
</div>
152150

src/type-layout.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,7 @@ struct.size = current_offset + padding_needed_for(current_offset, struct.alignme
256256

257257
<div class="warning">
258258

259-
Warning: This pseudocode uses a naive algorithm that ignores overflow issues for
260-
the sake of clarity. To perform memory layout computations in actual code, use
261-
[`Layout`].
259+
Warning: This pseudocode uses a naive algorithm that ignores overflow issues for the sake of clarity. To perform memory layout computations in actual code, use [`Layout`].
262260

263261
</div>
264262

@@ -310,13 +308,7 @@ the default `enum` size and alignment for the target platform's C ABI.
310308
311309
<div class="warning">
312310

313-
Warning: There are crucial differences between an `enum` in the C language and
314-
Rust's [field-less enums] with this representation. An `enum` in C is
315-
mostly a `typedef` plus some named constants; in other words, an object of an
316-
`enum` type can hold any integer value. For example, this is often used for
317-
bitflags in `C`. In contrast, Rust’s [field-less enums] can only legally hold
318-
the discriminant values, everything else is [undefined behavior]. Therefore,
319-
using a field-less enum in FFI to model a C `enum` is often wrong.
311+
Warning: There are crucial differences between an `enum` in the C language and Rust's [field-less enums] with this representation. An `enum` in C is mostly a `typedef` plus some named constants; in other words, an object of an `enum` type can hold any integer value. For example, this is often used for bitflags in `C`. In contrast, Rust’s [field-less enums] can only legally hold the discriminant values, everything else is [undefined behavior]. Therefore, using a field-less enum in FFI to model a C `enum` is often wrong.
320312

321313
</div>
322314

0 commit comments

Comments
 (0)