about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-05-30 11:56:32 +0000
committerbors <bors@rust-lang.org>2019-05-30 11:56:32 +0000
commitaee7012fab26d5e307a2fe767e4e7c847c5a45ee (patch)
treec960557e317e8e2d73db61fd13894d62884b2a66 /src/liballoc
parentc28084ac16af4ab594b6860958df140e7c876a13 (diff)
parent528972a28aa9e7e303e2283a31469c12c3d87e23 (diff)
downloadrust-aee7012fab26d5e307a2fe767e4e7c847c5a45ee.tar.gz
rust-aee7012fab26d5e307a2fe767e4e7c847c5a45ee.zip
Auto merge of #61343 - Centril:rollup-dzsuo01, r=Centril
Rollup of 11 pull requests

Successful merges:

 - #60802 (upgrade rustdoc's `pulldown-cmark` to 0.5.2)
 - #60839 (Fix ICE with struct ctors and const generics.)
 - #60850 (Stabilize RefCell::try_borrow_unguarded)
 - #61231 (Fix linkage diagnostic so it doesn't ICE for external crates)
 - #61244 (Box::into_vec: use Box::into_raw instead of mem::forget)
 - #61279 (implicit `Option`-returning doctests)
 - #61280 (Revert "Disable solaris target since toolchain no longer builds")
 - #61284 (Update all s3 URLs used on CI with subdomains)
 - #61321 (libsyntax: introduce 'fn is_keyword_ahead(dist, keywords)'.)
 - #61322 (ci: display more debug information in the init_repo script)
 - #61333 (Fix ICE with APIT in a function with a const parameter)

Failed merges:

 - #61304 (Speed up Azure CI installing Windows dependencies)

r? @ghost
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/slice.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs
index 8768f1ff081..aeb7f90d3e6 100644
--- a/src/liballoc/slice.rs
+++ b/src/liballoc/slice.rs
@@ -137,17 +137,16 @@ pub use hack::to_vec;
 // `core::slice::SliceExt` - we need to supply these functions for the
 // `test_permutations` test
 mod hack {
-    use core::mem;
-
     use crate::boxed::Box;
     use crate::vec::Vec;
     #[cfg(test)]
     use crate::string::ToString;
 
-    pub fn into_vec<T>(mut b: Box<[T]>) -> Vec<T> {
+    pub fn into_vec<T>(b: Box<[T]>) -> Vec<T> {
         unsafe {
-            let xs = Vec::from_raw_parts(b.as_mut_ptr(), b.len(), b.len());
-            mem::forget(b);
+            let len = b.len();
+            let b = Box::into_raw(b);
+            let xs = Vec::from_raw_parts(b as *mut T, len, len);
             xs
         }
     }