mirror of
https://github.com/rust-lang/rust
synced 2024-10-14 04:23:37 +00:00
Rollup merge of #42717 - ollie27:into_to_from2, r=sfackler
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.
This commit is contained in:
commit
dbe16e067f
|
@ -2124,10 +2124,12 @@ fn from(s: Box<[T]>) -> Vec<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[stable(feature = "box_from_vec", since = "1.18.0")]
|
// note: test pulls in libstd, which causes errors here
|
||||||
impl<T> Into<Box<[T]>> for Vec<T> {
|
#[cfg(not(test))]
|
||||||
fn into(self) -> Box<[T]> {
|
#[stable(feature = "box_from_vec", since = "1.20.0")]
|
||||||
self.into_boxed_slice()
|
impl<T> From<Vec<T>> for Box<[T]> {
|
||||||
|
fn from(v: Vec<T>) -> Box<[T]> {
|
||||||
|
v.into_boxed_slice()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue