mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-02 06:28:20 +03:00
97005678c3
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.