Skip to content

Commit

Permalink
Auto merge of rust-lang#135365 - saethlin:box-new, r=<try>
Browse files Browse the repository at this point in the history
Use Box::new instead of the box_new intrinsic in vec! expansion

r? ghost

This should perf differently since rust-lang#135274 landed.

Some UI tests are failing locally and seem to indicate a diagnostic regression that I'll fix if this perfs well.
  • Loading branch information
bors committed Jan 11, 2025
2 parents ce55b20 + fe921ed commit a33faef
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions library/alloc/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ macro_rules! vec {
);
($($x:expr),+ $(,)?) => (
<[_]>::into_vec(
// Using the intrinsic produces a dramatic improvement in compile
// time when constructing arrays with many elements.
$crate::boxed::box_new([$($x),+])
$crate::boxed::Box::new([$($x),+])
)
);
}
Expand Down

0 comments on commit a33faef

Please sign in to comment.