@@ -17,9 +17,13 @@ Unlike C, Undefined Behavior is pretty limited in scope in Rust. All the core
17
17
language cares about is preventing the following things:
18
18
19
19
* Dereferencing (using the ` * ` operator on) null, dangling, or unaligned
20
- pointers, or fat pointers with invalid metadata (see below)
20
+ pointers, or wide pointers with invalid metadata (see below)
21
21
* Reading [ uninitialized memory] [ ]
22
22
* Breaking the [ pointer aliasing rules] [ ]
23
+ * Unwinding into another language
24
+ * Causing a [ data race] [ race ]
25
+ * Executing code compiled with target features that the current thread of execution does
26
+ not support (see [ ` target_feature ` ] )
23
27
* Producing invalid primitive values (either alone or as a field of a compound
24
28
type such as ` enum ` /` struct ` /array/tuple):
25
29
* a ` bool ` that isn't 0 or 1
@@ -28,7 +32,7 @@ language cares about is preventing the following things:
28
32
* a ` char ` outside the ranges [ 0x0, 0xD7FF] and [ 0xE000, 0x10FFFF]
29
33
* a ` ! ` (all values are invalid for this type)
30
34
* dangling/null/unaligned references, references that do themselves point to
31
- invalid values, or fat references (to a dynamically sized type) with
35
+ invalid values, or wide references (to a dynamically sized type) with
32
36
invalid metadata
33
37
* slice metadata is invalid if the slice has a total size larger than
34
38
` isize::MAX ` bytes in memory
@@ -38,11 +42,7 @@ language cares about is preventing the following things:
38
42
* an uninitialized integer (` i* ` /` u* ` ), floating point value (` f* ` ), or raw
39
43
pointer
40
44
* an invalid library type with custom invalid values, such as a ` NonNull ` or
41
- ` NonZero* ` that is 0
42
- * Unwinding into another language
43
- * Causing a [ data race] [ race ]
44
- * Executing code compiled with target features that the current thread of execution does
45
- not support (see [ ` target_feature ` ] )
45
+ the ` NonZero ` family of types, that is 0
46
46
47
47
"Producing" a value happens any time a value is assigned, passed to a
48
48
function/primitive operation or returned from a function/primitive operation.
0 commit comments