limit From impl to LengthAtMost32

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
This commit is contained in:
Joshua Nelson 2020-01-31 11:41:19 -05:00
parent daeb8ece8c
commit f267d9dc19
1 changed files with 4 additions and 1 deletions

View File

@ -2398,7 +2398,10 @@ impl<T: Clone> From<&mut [T]> for Vec<T> {
}
#[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 {
<[T]>::into_vec(box arr)
}