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
This commit is contained in:
commit
7f294e4c18
@ -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())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user