Skip to content

Commit

Permalink
Auto merge of #39466 - alexcrichton:fix, r=Manishearth
Browse files Browse the repository at this point in the history
std: Fix IntoIter::as_mut_slice's signature

This was intended to require `&mut self`, not `&self`, otherwise it's unsound!

Closes #39465
  • Loading branch information
bors committed Feb 3, 2017
2 parents eedaa94 + 80f7db6 commit 7f294e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libcollections/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1958,7 +1958,7 @@ impl<T> IntoIter<T> {
/// assert_eq!(into_iter.next().unwrap(), 'z');
/// ```
#[stable(feature = "vec_into_iter_as_slice", since = "1.15.0")]
pub fn as_mut_slice(&self) -> &mut [T] {
pub fn as_mut_slice(&mut self) -> &mut [T] {
unsafe {
slice::from_raw_parts_mut(self.ptr as *mut T, self.len())
}
Expand Down

0 comments on commit 7f294e4

Please sign in to comment.