From c8da32158189118790e64873be6493cfdedbeac1 Mon Sep 17 00:00:00 2001 From: Dylan MacKenzie Date: Wed, 4 Jul 2018 12:02:26 -0700 Subject: [PATCH] Resolve null/ZST conflict correctly (whoops) --- src/libcore/ptr.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 7687f16b4ce4..1d8c3696b459 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,