about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2017-06-20 16:28:26 -0400
committerGitHub <noreply@github.com>2017-06-20 16:28:26 -0400
commitdbe16e067f913b2985a3a2e5a5e70d9353c8290a (patch)
tree5d2c8d033bee97eea57552bd7717cb6061c283d2 /src/liballoc
parent4c43bc32b723f0727456e7d40fb5feeeb1c4d448 (diff)
parent222a328f5c5d4d6aeaee6b9d9583e9b6799a1c63 (diff)
downloadrust-dbe16e067f913b2985a3a2e5a5e70d9353c8290a.tar.gz
rust-dbe16e067f913b2985a3a2e5a5e70d9353c8290a.zip
Rollup merge of #42717 - ollie27:into_to_from2, r=sfackler
Convert `Into<Box<[T]>> for Vec<T>` into `From<Vec<T>> for Box<[T]>`

As the `collections` crate has been merged into `alloc` in #42648 this impl is now possible. This is the final part of #42129 missing from #42227.
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/vec.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs
index 8bb16febb04..c9c7a27c614 100644
--- a/src/liballoc/vec.rs
+++ b/src/liballoc/vec.rs
@@ -2124,10 +2124,12 @@ impl<T> From<Box<[T]>> for Vec<T> {
     }
 }
 
-#[stable(feature = "box_from_vec", since = "1.18.0")]
-impl<T> Into<Box<[T]>> for Vec<T> {
-    fn into(self) -> Box<[T]> {
-        self.into_boxed_slice()
+// note: test pulls in libstd, which causes errors here
+#[cfg(not(test))]
+#[stable(feature = "box_from_vec", since = "1.20.0")]
+impl<T> From<Vec<T>> for Box<[T]> {
+    fn from(v: Vec<T>) -> Box<[T]> {
+        v.into_boxed_slice()
     }
 }