Skip to content

Commit 28ea002

Browse files
committed
Add small clarification around using pointers derived from references
Signed-off-by: Alex Saveau <[email protected]>
1 parent 4827cee commit 28ea002

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/core/src/ptr/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
//! be used for inter-thread synchronization.
3636
//! * The result of casting a reference to a pointer is valid for as long as the
3737
//! underlying object is live and no reference (just raw pointers) is used to
38-
//! access the same memory.
38+
//! access the same memory. That is, reference and pointer accesses cannot be
39+
//! interleaved.
3940
//!
4041
//! These axioms, along with careful use of [`offset`] for pointer arithmetic,
4142
//! are enough to correctly implement many useful things in unsafe code. Stronger guarantees
@@ -64,7 +65,6 @@
6465
//! separate allocated object), heap allocations (each allocation created by the global allocator is
6566
//! a separate allocated object), and `static` variables.
6667
//!
67-
//!
6868
//! # Strict Provenance
6969
//!
7070
//! **The following text is non-normative, insufficiently formal, and is an extremely strict

0 commit comments

Comments
 (0)