From 81e738b501134f73d751089f19fed02d75183805 Mon Sep 17 00:00:00 2001 From: Alex Saveau Date: Fri, 4 Nov 2022 20:28:54 -0700 Subject: [PATCH] Add small clarification around using pointers derived from references Signed-off-by: Alex Saveau --- core/src/ptr/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/ptr/mod.rs b/core/src/ptr/mod.rs index 565c38d22..fd6fe46bf 100644 --- a/core/src/ptr/mod.rs +++ b/core/src/ptr/mod.rs @@ -35,7 +35,8 @@ //! be used for inter-thread synchronization. //! * The result of casting a reference to a pointer is valid for as long as the //! underlying object is live and no reference (just raw pointers) is used to -//! access the same memory. +//! access the same memory. That is, reference and pointer accesses cannot be +//! interleaved. //! //! These axioms, along with careful use of [`offset`] for pointer arithmetic, //! are enough to correctly implement many useful things in unsafe code. Stronger guarantees @@ -64,7 +65,6 @@ //! separate allocated object), heap allocations (each allocation created by the global allocator is //! a separate allocated object), and `static` variables. //! -//! //! # Strict Provenance //! //! **The following text is non-normative, insufficiently formal, and is an extremely strict