Skip to content

Commit a3b6680

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

File tree

6 files changed

+17
-27
lines changed

6 files changed

+17
-27
lines changed

src/behavior-considered-undefined.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,9 @@ undefined behavior, it is *unsound*.
1515
<div class="warning">
1616

1717
***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).
18+
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.
19+
We also reserve the right to make some of the behavior in that list defined in the future.
20+
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).
2421

2522
Please read the [Rustonomicon] before writing unsafe code.
2623

src/conditional-compilation.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ configuration option from within the source code of the crate being compiled.
5757
5858
<div class="warning">
5959

60-
Warning: Arbitrarily-set configuration options can clash with compiler-set configuration options. For example, it is possible to do `rustc --cfg "unix" program.rs` while compiling to a Windows target, and have both `unix` and `windows` configuration options set at the same time. Doing this would be unwise.
60+
Warning: Arbitrarily-set configuration options can clash with compiler-set configuration options.
61+
For example, it is possible to do `rustc --cfg "unix" program.rs` while compiling to a Windows target, and have both `unix` and `windows` configuration options set at the same time.
62+
Doing this would be unwise.
6163

6264
</div>
6365

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: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,8 @@ 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.
97+
It is still valid to put `extern crate std;` into the crate and dependencies can also link it in.
9998
10099
</div>
101100

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: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,8 @@ 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.
260+
To perform memory layout computations in actual code, use [`Layout`].
262261

263262
</div>
264263

@@ -310,13 +309,11 @@ the default `enum` size and alignment for the target platform's C ABI.
310309
311310
<div class="warning">
312311

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.
312+
Warning: There are crucial differences between an `enum` in the C language and Rust's [field-less enums] with this representation.
313+
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.
314+
For example, this is often used for bitflags in `C`.
315+
In contrast, Rust’s [field-less enums] can only legally hold the discriminant values, everything else is [undefined behavior].
316+
Therefore, using a field-less enum in FFI to model a C `enum` is often wrong.
320317

321318
</div>
322319

0 commit comments

Comments
 (0)