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() } }