diff --git a/alloc/src/boxed.rs b/alloc/src/boxed.rs index 5f20729568352..3e791416820ef 100644 --- a/alloc/src/boxed.rs +++ b/alloc/src/boxed.rs @@ -1688,7 +1688,7 @@ impl Default for Box { /// Creates a `Box`, with the `Default` value for T. #[inline] fn default() -> Self { - Box::new(T::default()) + Box::write(Box::new_uninit(), T::default()) } }