Skip to content

Commit

Permalink
clarify wording
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed May 2, 2019
1 parent 1e47250 commit 30cf0e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/libcore/slice/mod.rs
Expand Up @@ -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.
Expand Down
5 changes: 2 additions & 3 deletions src/libcore/str/mod.rs
Expand Up @@ -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
Expand Down

0 comments on commit 30cf0e4

Please sign in to comment.