From 222a328f5c5d4d6aeaee6b9d9583e9b6799a1c63 Mon Sep 17 00:00:00 2001 From: Oliver Middleton Date: Sat, 17 Jun 2017 16:56:05 +0100 Subject: [PATCH] Convert `Into> for Vec` into `From> for Box<[T]>` --- src/liballoc/vec.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index 8bb16febb0483..c9c7a27c614fa 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -2124,10 +2124,12 @@ impl From> for Vec { } } -#[stable(feature = "box_from_vec", since = "1.18.0")] -impl Into> for Vec { - 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 From> for Box<[T]> { + fn from(v: Vec) -> Box<[T]> { + v.into_boxed_slice() } }