about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorOliver Middleton <olliemail27@gmail.com>2017-06-17 16:56:05 +0100
committerOliver Middleton <olliemail27@gmail.com>2017-06-17 20:49:21 +0100
commit222a328f5c5d4d6aeaee6b9d9583e9b6799a1c63 (patch)
tree126d39dbd5296f2a4dcf5aa3cd666b6d481211e1 /src/liballoc
parentdfb8c80e118a6844e3a7130a884e92dde4ef4694 (diff)
downloadrust-222a328f5c5d4d6aeaee6b9d9583e9b6799a1c63.tar.gz
rust-222a328f5c5d4d6aeaee6b9d9583e9b6799a1c63.zip
Convert `Into<Box<[T]>> for Vec<T>` into `From<Vec<T>> for Box<[T]>`
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()
     }
 }