diff options
| author | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2018-07-04 12:02:26 -0700 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2018-08-29 10:10:58 +0200 |
| commit | c8da32158189118790e64873be6493cfdedbeac1 (patch) | |
| tree | 9a123e45c8395077b0131cf091a4259b09db755a /src/libcore | |
| parent | 7e165d90a6f4dfeb472e6385edc6cd8ef79695a1 (diff) | |
| download | rust-c8da32158189118790e64873be6493cfdedbeac1.tar.gz rust-c8da32158189118790e64873be6493cfdedbeac1.zip | |
Resolve null/ZST conflict correctly (whoops)
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/ptr.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 7687f16b4ce..1d8c3696b45 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -42,10 +42,9 @@ //! //! * The result of casting a reference to a pointer is valid for as long as the //! underlying object is live. -//! * All pointers to types with a [size of zero][zst] are valid for all -//! operations of size zero. -//! * A [null] pointer is *never* valid, except when it points to a zero-sized -//! type. +//! * A [null] pointer is *never* valid. +//! * All pointers (except for the null pointer) are valid for all operations of +//! [size zero][zst]. //! //! These axioms, along with careful use of [`offset`] for pointer arithmentic, //! are enough to correctly implement many useful things in unsafe code. Still, |
