From: Oliver Middleton Date: Sat, 17 Jun 2017 15:56:05 +0000 (+0100) Subject: Convert `Into> for Vec` into `From> for Box<[T]>` X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=222a328f5c5d4d6aeaee6b9d9583e9b6799a1c63;p=rust.git Convert `Into> for Vec` into `From> for Box<[T]>` --- 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 @@ fn from(s: Box<[T]>) -> 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() } }