diff options
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/vec.rs | 10 |
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() } } |
