From 6024a06dbad00a71e687d1709dc0d4e1b42d3c2e Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Sat, 11 Jan 2025 08:26:57 -0500 Subject: [PATCH] Update the explanation for why we use box_new in vec! --- library/alloc/src/macros.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/alloc/src/macros.rs b/library/alloc/src/macros.rs index 6ee3907cc8ea2..c000fd6f4efa7 100644 --- a/library/alloc/src/macros.rs +++ b/library/alloc/src/macros.rs @@ -48,8 +48,8 @@ macro_rules! vec { ); ($($x:expr),+ $(,)?) => ( <[_]>::into_vec( - // Using the intrinsic produces a dramatic improvement in compile - // time when constructing arrays with many elements. + // Using the intrinsic produces a dramatic improvement in stack usage for + // unoptimized programs using this code path to construct large Vecs. $crate::boxed::box_new([$($x),+]) ) );