Skip to content

Commit 24cc0cb

Browse files
Rollup merge of #135365 - saethlin:box-new, r=compiler-errors
Update the explanation for why we use box_new in vec! The perf run in this PR demonstrates that there is no longer a dramatic change in compile time with the intrinsic `box_new` vs calling `Box::new`, but I've locally confirmed that there is still a dramatic change in stack use.
2 parents 9d3ae11 + 6024a06 commit 24cc0cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/alloc/src/macros.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ macro_rules! vec {
4848
);
4949
($($x:expr),+ $(,)?) => (
5050
<[_]>::into_vec(
51-
// Using the intrinsic produces a dramatic improvement in compile
52-
// time when constructing arrays with many elements.
51+
// Using the intrinsic produces a dramatic improvement in stack usage for
52+
// unoptimized programs using this code path to construct large Vecs.
5353
$crate::boxed::box_new([$($x),+])
5454
)
5555
);

0 commit comments

Comments
 (0)