mirror of
https://github.com/rust-lang/rust.git
synced 2026-03-27 16:06:00 +00:00
The `Box::new(T::default())` implementation of `Box::default` only had two stack copies in debug mode, compared to the current version, which has four. By avoiding creating any `MaybeUninit<T>`'s and just writing `T` directly to the `Box` pointer, the stack usage in debug mode remains the same as the old version.
790 B
790 B