We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4e6ea83 commit 2826ff5Copy full SHA for 2826ff5
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 that 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 is inside `union`s, and between the
63
+fields of a compound type (in the "padding").
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