Skip to content

Commit 30cf0e4

Browse files
committed
clarify wording
1 parent 1e47250 commit 30cf0e4

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/libcore/slice/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,8 @@ impl<T> [T] {
360360
/// function returns, or else it will end up pointing to garbage.
361361
///
362362
/// The caller must also ensure that the memory the pointer (non-transitively) points to
363-
/// is never written to (except inside an `UnsafeCell`). If you need to mutate
364-
/// the contents of the slice, use [`as_mut_ptr`].
363+
/// is never written to (except inside an `UnsafeCell`) using this pointer or any pointer
364+
/// derived from it. If you need to mutate the contents of the slice, use [`as_mut_ptr`].
365365
///
366366
/// Modifying the container referenced by this slice may cause its buffer
367367
/// to be reallocated, which would also make any pointers to it invalid.

src/libcore/str/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -2188,9 +2188,8 @@ impl str {
21882188
/// [`u8`]. This pointer will be pointing to the first byte of the string
21892189
/// slice.
21902190
///
2191-
/// The caller must ensure that the memory the pointer points to
2192-
/// is never written to. If you need to mutate
2193-
/// the contents of the string slice, use [`as_mut_ptr`].
2191+
/// The caller must ensure that the returned pointer is never written to.
2192+
/// If you need to mutate the contents of the string slice, use [`as_mut_ptr`].
21942193
///
21952194
/// [`u8`]: primitive.u8.html
21962195
/// [`as_mut_ptr`]: #method.as_mut_ptr

0 commit comments

Comments
 (0)