File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -76,10 +76,14 @@ reading uninitialized memory is permitted are inside `union`s and in "padding"
7676[ dangling ] : #dangling-pointers
7777
7878A reference/pointer is "dangling" if it is null or not all of the bytes it
79- points to are part of the same allocation (so in particular they all have to be
79+ points to are part of the same live allocation (so in particular they all have to be
8080part of * some* allocation). The span of bytes it points to is determined by the
8181pointer value and the size of the pointee type (using ` size_of_val ` ).
8282
83+ If the size is 0, then the pointer must either point inside of a live allocation
84+ (including pointing just after the last byte of the allocation), or it must be
85+ directly constructed from a non-zero integer literal.
86+
8387Note that dynamically sized types (such as slices and strings) point to their
8488entire range, so it is important that the length metadata is never too large. In
8589particular, the dynamic size of a Rust value (as determined by ` size_of_val ` )
You can’t perform that action at this time.
0 commit comments