about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-02-03 00:47:58 +0000
committerbors <bors@rust-lang.org>2017-02-03 00:47:58 +0000
commit7f294e4c186b461ee8fc28c75d4216822a535d7a (patch)
tree237a95cecabe511b09eaf6a44c3c744a092646bb
parenteedaa94e330094a84f4df9aa52949515327f8e80 (diff)
parent80f7db63b6e658468f181d602767c8da412459d2 (diff)
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
-rw-r--r--src/libcollections/vec.rs2
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())
         }