mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-02 13:07:37 +00:00
limit From impl to LengthAtMost32
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
This commit is contained in:
parent
daeb8ece8c
commit
f267d9dc19
@ -2398,7 +2398,10 @@ impl<T: Clone> From<&mut [T]> for Vec<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[stable(feature = "vec_from_array", since = "1.42.0")]
|
#[stable(feature = "vec_from_array", since = "1.42.0")]
|
||||||
impl<T, const N: usize> From<[T; N]> for Vec<T> {
|
impl<T, const N: usize> From<[T; N]> for Vec<T>
|
||||||
|
where
|
||||||
|
[T; N]: LengthAtMost32,
|
||||||
|
{
|
||||||
fn from(arr: [T; N]) -> Self {
|
fn from(arr: [T; N]) -> Self {
|
||||||
<[T]>::into_vec(box arr)
|
<[T]>::into_vec(box arr)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user