about summary refs log tree commit diff
path: root/src/libcore/ptr
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2019-11-05 09:55:33 +0100
committerRalf Jung <post@ralfj.de>2019-11-05 09:55:33 +0100
commit1a254e4f434e0cbb9ffcb24971416cb574df4751 (patch)
treed3409ea87443e199368e8dbfc8c9c01e228243c6 /src/libcore/ptr
parent82dc3aa5fb6642fe0450305015ee68e0c2d1d492 (diff)
expand slice from_raw_part docs
Diffstat (limited to 'src/libcore/ptr')
-rw-r--r--src/libcore/ptr/mod.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libcore/ptr/mod.rs b/src/libcore/ptr/mod.rs
index 649244a4683..407f8a6218e 100644
--- a/src/libcore/ptr/mod.rs
+++ b/src/libcore/ptr/mod.rs
@@ -18,6 +18,10 @@
 //! * A [null] pointer is *never* valid, not even for accesses of [size zero][zst].
 //! * All pointers (except for the null pointer) are valid for all operations of
 //!   [size zero][zst].
+//! * For a pointer to be valid, it is necessary (but not always sufficient) that the pointer
+//!   be *dereferencable*: the memory range of the given size starting at the pointer must all be
+//!   within the bounds of a single allocated object. Note that in Rust,
+//!   every (stack-allocated) variable is considered a separate allocated object.
 //! * All accesses performed by functions in this module are *non-atomic* in the sense
 //!   of [atomic operations] used to synchronize between threads. This means it is
 //!   undefined behavior to perform two concurrent accesses to the same location from different