@@ -22,16 +22,21 @@ language cares about is preventing the following things:
22
22
* Breaking the [ pointer aliasing rules] [ ]
23
23
* Producing invalid primitive values (either alone or as a field of a compound
24
24
type such as ` enum ` /` struct ` /array/tuple):
25
- * dangling/null/unaligned references
25
+ * dangling/null/unaligned references, references that do themselves point to
26
+ invalid values, or fat references (to a dynamically sized type) with
27
+ invalid metadata
26
28
* null ` fn ` pointers
27
29
* a ` bool ` that isn't 0 or 1
28
30
* an undefined ` enum ` discriminant
29
31
* a ` char ` outside the ranges [ 0x0, 0xD7FF] and [ 0xE000, 0x10FFFF]
30
32
* a non-utf8 ` str `
33
+ * an uninitialized integer (` i* ` /` u* ` ) or floating point value (` f* ` )
31
34
* an invalid library type with custom invalid values, such as a ` NonNull ` or
32
35
` NonZero* ` that is 0
33
36
* Unwinding into another language
34
37
* Causing a [ data race] [ race ]
38
+ * Executing code compiled with platform features that the current platform does
39
+ not support (see [ ` target_feature ` ] )
35
40
36
41
"Producing" a value happens any time a value is assigned, passed to a
37
42
function/primitive operation or returned from a function/primitive operation.
@@ -69,3 +74,4 @@ these problems are considered impractical to categorically prevent.
69
74
[ pointer aliasing rules ] : references.html
70
75
[ uninitialized memory ] : uninitialized.html
71
76
[ race ] : races.html
77
+ [ `target_feature` ] : ../reference/attributes/codegen.html#the-target_feature-attribute
0 commit comments