Skip to content

Commit 5311126

Browse files
committedJun 17, 2017
Auto merge of #42717 - ollie27:into_to_from2, r=<try>
Convert `Into<Box<[T]>> for Vec<T>` into `From<Vec<T>> for Box<[T]>` As the `collections` crate has been merged into `alloc` in #42648 this impl is now possible. This is the final part of #42129 missing from #42227.
2 parents 78d8416 + 222a328 commit 5311126

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed
 

‎src/liballoc/vec.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -2124,10 +2124,12 @@ impl<T> From<Box<[T]>> for Vec<T> {
21242124
}
21252125
}
21262126

2127-
#[stable(feature = "box_from_vec", since = "1.18.0")]
2128-
impl<T> Into<Box<[T]>> for Vec<T> {
2129-
fn into(self) -> Box<[T]> {
2130-
self.into_boxed_slice()
2127+
// note: test pulls in libstd, which causes errors here
2128+
#[cfg(not(test))]
2129+
#[stable(feature = "box_from_vec", since = "1.20.0")]
2130+
impl<T> From<Vec<T>> for Box<[T]> {
2131+
fn from(v: Vec<T>) -> Box<[T]> {
2132+
v.into_boxed_slice()
21312133
}
21322134
}
21332135

0 commit comments

Comments
 (0)