We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2bd29ae + 8aa6f0f commit 25391dbCopy full SHA for 25391db
src/behavior-considered-undefined.md
@@ -57,6 +57,11 @@ code.
57
> **Note**: `rustc` achieves this with the unstable
58
> `rustc_layout_scalar_valid_range_*` attributes.
59
60
+**Note:** Uninitialized memory is also implicitly invalid for any type that has
61
+a restricted set of valid values. In other words, the only cases in which
62
+reading uninitialized memory is permitted are inside `union`s and in "padding"
63
+(the gaps between the fields/elements of a type).
64
+
65
A reference/pointer is "dangling" if it is null or not all of the bytes it
66
points to are part of the same allocation (so in particular they all have to be
67
part of *some* allocation). The span of bytes it points to is determined by the
0 commit comments