diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2017-02-02 11:26:44 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2017-02-02 11:27:52 -0800 |
| commit | 80f7db63b6e658468f181d602767c8da412459d2 (patch) | |
| tree | ab606943ac1550b2316308340dd31a16223f644f /src | |
| parent | 24055d0f2aa8dce5caed7544e6006aa48dceaea5 (diff) | |
| download | rust-80f7db63b6e658468f181d602767c8da412459d2.tar.gz rust-80f7db63b6e658468f181d602767c8da412459d2.zip | |
std: Fix IntoIter::as_mut_slice's signature
This was intended to require `&mut self`, not `&self`, otherwise it's unsound! Closes #39465
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcollections/vec.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index 1f8fd32da9a..c45518438bd 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -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()) } |
