You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/behavior-considered-undefined.md
+4-13
Original file line number
Diff line number
Diff line change
@@ -12,19 +12,10 @@ behaviors. `unsafe` code that satisfies this property for any safe client is
12
12
called *sound*; if `unsafe` code can be misused by safe code to exhibit
13
13
undefined behavior, it is *unsound*.
14
14
15
-
<divclass="warning">
16
-
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).
24
-
25
-
Please read the [Rustonomicon] before writing unsafe code.
26
-
27
-
</div>
15
+
> [!WARNING]
16
+
> 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).
17
+
>
18
+
> Please read the [Rustonomicon] before writing unsafe code.
28
19
29
20
* Data races.
30
21
* Accessing (loading from or storing to) a place that is [dangling] or [based on
Copy file name to clipboardexpand all lines: src/conditional-compilation.md
+2-5
Original file line number
Diff line number
Diff line change
@@ -55,11 +55,8 @@ configuration option from within the source code of the crate being compiled.
55
55
> by [Cargo][cargo-feature] for specifying compile-time options and optional
56
56
> dependencies.
57
57
58
-
<divclass="warning">
59
-
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.
61
-
62
-
</div>
58
+
> [!WARNING]
59
+
> 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.
Copy file name to clipboardexpand all lines: src/items/external-blocks.md
+2-8
Original file line number
Diff line number
Diff line change
@@ -292,14 +292,8 @@ to link against. An ordinal is a unique number per symbol exported by a dynamic
292
292
library on Windows and can be used when the library is being loaded to find
293
293
that symbol rather than having to look it up by name.
294
294
295
-
<divclass="warning">
296
-
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.
301
-
302
-
</div>
295
+
> [!WARNING]
296
+
> `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.
Copy file name to clipboardexpand all lines: src/patterns.md
+2-7
Original file line number
Diff line number
Diff line change
@@ -142,13 +142,8 @@ if let (a, 3) = (1, 2) { // "(a, 3)" is refutable, and will not match
142
142
_Literal patterns_ match exactly the same value as what is created by the literal.
143
143
Since negative numbers are not [literals], literal patterns also accept an optional minus sign before the literal, which acts like the negation operator.
144
144
145
-
<divclass="warning">
146
-
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.
150
-
151
-
</div>
145
+
> [!WARNING]
146
+
> 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.
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`].
262
-
263
-
</div>
257
+
> [!WARNING]
258
+
> 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`].
264
259
265
260
> Note: This algorithm can produce zero-sized structs. In C, an empty struct
266
261
> declaration like `struct Foo { }` is illegal. However, both gcc and clang
@@ -308,17 +303,8 @@ the default `enum` size and alignment for the target platform's C ABI.
308
303
> really a "best guess". In particular, this may be incorrect when the C code
309
304
> of interest is compiled with certain flags.
310
305
311
-
<divclass="warning">
312
-
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.
320
-
321
-
</div>
306
+
> [!WARNING]
307
+
> 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.
0 commit comments