@@ -29,15 +29,15 @@ language cares about is preventing the following things:
29
29
* a null ` fn ` pointer
30
30
* a ` char ` outside the ranges [ 0x0, 0xD7FF] and [ 0xE000, 0x10FFFF]
31
31
* a ` ! ` (all values are invalid for this type)
32
+ * an integer (` i* ` /` u* ` ), floating point value (` f* ` ), or raw pointer read from
33
+ [ uninitialized memory] [ ]
32
34
* a reference/` Box ` that is dangling, unaligned, or points to an invalid value.
33
35
* a wide reference, ` Box ` , or raw pointer that has invalid metadata:
34
- * slice metadata is invalid if the slice has a total size larger than
35
- ` isize::MAX ` bytes in memory
36
36
* ` dyn Trait ` metadata is invalid if it is not a pointer to a vtable for
37
37
` Trait ` that matches the actual dynamic trait the reference points to
38
+ * slice metadata is invalid if the length is not a valid ` usize `
39
+ (i.e., it must not be read from uninitialized memory)
38
40
* a ` str ` that isn't valid UTF-8
39
- * an integer (` i* ` /` u* ` ), floating point value (` f* ` ), or raw pointer read from
40
- [ uninitialized memory] [ ]
41
41
* a type with custom invalid values that is one of those values, such as a
42
42
` NonNull ` that is null. (Requesting custom invalid values is an unstable
43
43
feature, but some stable libstd types, like ` NonNull ` , make use of it.)
0 commit comments