1
Fork 0

Use #[rustc_box] in alloc instead of box syntax

This commit is contained in:
est31 2022-05-28 16:37:52 +02:00
parent cfc21deebd
commit 535e28b6c6
4 changed files with 56 additions and 9 deletions

View file

@ -2983,12 +2983,15 @@ impl<T, const N: usize> From<[T; N]> for Vec<T> {
/// ```
#[cfg(not(test))]
fn from(s: [T; N]) -> Vec<T> {
<[T]>::into_vec(box s)
<[T]>::into_vec(
#[cfg_attr(not(bootstrap), rustc_box)]
Box::new(s),
)
}
#[cfg(test)]
fn from(s: [T; N]) -> Vec<T> {
crate::slice::into_vec(box s)
crate::slice::into_vec(Box::new(s))
}
}