pull/467/merge
Matthew Woodcraft 4 weeks ago committed by GitHub
commit 557fdbbba4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -106,9 +106,9 @@ consequence of types with no size. In particular, pointer offsets are no-ops,
and allocators typically [require a non-zero size][alloc].
Note that references to ZSTs (including empty slices), just like all other
references, must be non-null and suitably aligned. Dereferencing a null or
unaligned pointer to a ZST is [undefined behavior][ub], just like for any other
type.
references, must be non-null and suitably aligned. However, loading or storing
through a null pointer to a ZST is not [undefined behavior][ub], unlike
pointers to other types.
[alloc]: ../std/alloc/trait.GlobalAlloc.html#tymethod.alloc
[ub]: what-unsafe-does.html

Loading…
Cancel
Save