diff options
| author | est31 <MTest31@outlook.com> | 2022-05-28 16:37:52 +0200 |
|---|---|---|
| committer | est31 <MTest31@outlook.com> | 2022-06-01 02:28:34 +0200 |
| commit | 535e28b6c66a4e3fd5370a4f8b2fcecf12c4cc6a (patch) | |
| tree | 1f8a16c2f3d24812ceddf09fccd1e257585f5495 /library/alloc/src/vec | |
| parent | cfc21deebd948e99c553cb6ad14ddb91368257d3 (diff) | |
| download | rust-535e28b6c66a4e3fd5370a4f8b2fcecf12c4cc6a.tar.gz rust-535e28b6c66a4e3fd5370a4f8b2fcecf12c4cc6a.zip | |
Use #[rustc_box] in alloc instead of box syntax
Diffstat (limited to 'library/alloc/src/vec')
| -rw-r--r-- | library/alloc/src/vec/mod.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index d222fcb445f..4429984ea6c 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -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)) } } |
