Skip to content

Commit 7f294e4

Browse files
committed
Auto merge of #39466 - alexcrichton:fix, r=Manishearth
std: Fix IntoIter::as_mut_slice's signature This was intended to require `&mut self`, not `&self`, otherwise it's unsound! Closes #39465
2 parents eedaa94 + 80f7db6 commit 7f294e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcollections/vec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1958,7 +1958,7 @@ impl<T> IntoIter<T> {
19581958
/// assert_eq!(into_iter.next().unwrap(), 'z');
19591959
/// ```
19601960
#[stable(feature = "vec_into_iter_as_slice", since = "1.15.0")]
1961-
pub fn as_mut_slice(&self) -> &mut [T] {
1961+
pub fn as_mut_slice(&mut self) -> &mut [T] {
19621962
unsafe {
19631963
slice::from_raw_parts_mut(self.ptr as *mut T, self.len())
19641964
}

0 commit comments

Comments
 (0)