diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2017-02-02 11:26:44 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2017-02-04 01:00:40 +0000 |
| commit | 018fb3ed5ca7f4bb8742c1a09e112a7d02a4855d (patch) | |
| tree | 48441a3f9e8322d384446be60cda565f2846587f | |
| parent | 10893a9a349cdd423f2490a6984acb5b3b7c8046 (diff) | |
| download | rust-018fb3ed5ca7f4bb8742c1a09e112a7d02a4855d.tar.gz rust-018fb3ed5ca7f4bb8742c1a09e112a7d02a4855d.zip | |
std: Fix IntoIter::as_mut_slice's signature
This was intended to require `&mut self`, not `&self`, otherwise it's unsound! Closes #39465
| -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 f2ef54f6e56..e212592eda7 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -1929,7 +1929,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()) } |
