Skip to content

Commit c8da321

Browse files
ecstatic-morseRalfJung
authored andcommitted
Resolve null/ZST conflict correctly (whoops)
1 parent 7e165d9 commit c8da321

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/libcore/ptr.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,9 @@
4242
//!
4343
//! * The result of casting a reference to a pointer is valid for as long as the
4444
//! underlying object is live.
45-
//! * All pointers to types with a [size of zero][zst] are valid for all
46-
//! operations of size zero.
47-
//! * A [null] pointer is *never* valid, except when it points to a zero-sized
48-
//! type.
45+
//! * A [null] pointer is *never* valid.
46+
//! * All pointers (except for the null pointer) are valid for all operations of
47+
//! [size zero][zst].
4948
//!
5049
//! These axioms, along with careful use of [`offset`] for pointer arithmentic,
5150
//! are enough to correctly implement many useful things in unsafe code. Still,

0 commit comments

Comments
 (0)