about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libcore/slice/mod.rs4
-rw-r--r--src/libcore/str/mod.rs5
2 files changed, 4 insertions, 5 deletions
diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs
index c273153fa5e..50d2ba0d3ef 100644
--- a/src/libcore/slice/mod.rs
+++ b/src/libcore/slice/mod.rs
@@ -360,8 +360,8 @@ impl<T> [T] {
     /// function returns, or else it will end up pointing to garbage.
     ///
     /// The caller must also ensure that the memory the pointer (non-transitively) points to
-    /// is never written to (except inside an `UnsafeCell`). If you need to mutate
-    /// the contents of the slice, use [`as_mut_ptr`].
+    /// is never written to (except inside an `UnsafeCell`) using this pointer or any pointer
+    /// derived from it. If you need to mutate the contents of the slice, use [`as_mut_ptr`].
     ///
     /// Modifying the container referenced by this slice may cause its buffer
     /// to be reallocated, which would also make any pointers to it invalid.
diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs
index 96a5ce61ca0..ef4bd83cbc5 100644
--- a/src/libcore/str/mod.rs
+++ b/src/libcore/str/mod.rs
@@ -2188,9 +2188,8 @@ impl str {
     /// [`u8`]. This pointer will be pointing to the first byte of the string
     /// slice.
     ///
-    /// The caller must ensure that the memory the pointer points to
-    /// is never written to. If you need to mutate
-    /// the contents of the string slice, use [`as_mut_ptr`].
+    /// The caller must ensure that the returned pointer is never written to.
+    /// If you need to mutate the contents of the string slice, use [`as_mut_ptr`].
     ///
     /// [`u8`]: primitive.u8.html
     /// [`as_mut_ptr`]: #method.as_mut_ptr