Skip to content

Commit 018fb3e

Browse files
alexcrichtonbrson
authored andcommitted
std: Fix IntoIter::as_mut_slice's signature
This was intended to require `&mut self`, not `&self`, otherwise it's unsound! Closes #39465
1 parent 10893a9 commit 018fb3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcollections/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1929,7 +1929,7 @@ impl<T> IntoIter<T> {
19291929
/// assert_eq!(into_iter.next().unwrap(), 'z');
19301930
/// ```
19311931
#[stable(feature = "vec_into_iter_as_slice", since = "1.15.0")]
1932-
pub fn as_mut_slice(&self) -> &mut [T] {
1932+
pub fn as_mut_slice(&mut self) -> &mut [T] {
19331933
unsafe {
19341934
slice::from_raw_parts_mut(self.ptr as *mut T, self.len())
19351935
}

0 commit comments

Comments
 (0)