about summary refs log tree commit diff
path: root/library/core/src/ptr
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2023-08-21 13:54:03 +0200
committerRalf Jung <post@ralfj.de>2023-08-21 13:54:03 +0200
commit0188b9cbb43c2631111281fad0624f8bb0538e3a (patch)
treec9a08aa9878c1b5deb064d91f6b0e859e01a7bbd /library/core/src/ptr
parentb9c15c5d3bfb503676fffccab69fe27c5b532283 (diff)
try to clarify wording
Diffstat (limited to 'library/core/src/ptr')
-rw-r--r--library/core/src/ptr/mod.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs
index f8badc4130d..69d775075f3 100644
--- a/library/core/src/ptr/mod.rs
+++ b/library/core/src/ptr/mod.rs
@@ -795,10 +795,9 @@ pub const fn slice_from_raw_parts_mut<T>(data: *mut T, len: usize) -> *mut [T] {
 ///
 /// Behavior is undefined if any of the following conditions are violated:
 ///
-/// * Both `x` and `y` must be [valid] for both reads and writes.
-///
-/// * `x` must remain valid for reads and writes even after `y` is read/written, and vice versa.
-///   (In other words, there cannot be aliasing restrictions on the use of these pointers.)
+/// * Both `x` and `y` must be [valid] for both reads and writes. They must remain valid even if the
+///   other pointer is written. (This means if the memory ranges overlap, the two pointers must not
+///   be subject to aliasing restrictions relative to each other.)
 ///
 /// * Both `x` and `y` must be properly aligned.
 ///