Skip to content

Commit

Permalink
Rollup merge of rust-lang#40603 - QuietMisdreavus:slice-ptr-docs, r=G…
Browse files Browse the repository at this point in the history
…uillaumeGomez

minor wording tweak to slice::{as_ptr, as_mut_ptr}

Per rust-lang#37334, the slice-as-pointer methods mentioned that "modifying the slice may cause its buffer to be reallocated", when in fact modifying the *slice* itself would cause no such change. (It is a borrow, after all!) This is a tweak to the wording of that line to stress it's the *collection* that could cause the buffer to be reallocated.

r? @steveklabnik
  • Loading branch information
frewsxcv committed Mar 18, 2017
2 parents 99b8b6a + 963d4df commit 4407289
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libcollections/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,8 @@ impl<T> [T] {
/// The caller must ensure that the slice outlives the pointer this
/// function returns, or else it will end up pointing to garbage.
///
/// Modifying the slice may cause its buffer to be reallocated, which
/// would also make any pointers to it invalid.
/// Modifying the container referenced by this slice may cause its buffer
/// to be reallocated, which would also make any pointers to it invalid.
///
/// # Examples
///
Expand All @@ -463,8 +463,8 @@ impl<T> [T] {
/// The caller must ensure that the slice outlives the pointer this
/// function returns, or else it will end up pointing to garbage.
///
/// Modifying the slice may cause its buffer to be reallocated, which
/// would also make any pointers to it invalid.
/// Modifying the container referenced by this slice may cause its buffer
/// to be reallocated, which would also make any pointers to it invalid.
///
/// # Examples
///
Expand Down

0 comments on commit 4407289

Please sign in to comment.