diff --git a/src/libcore/mem/maybe_uninit.rs b/src/libcore/mem/maybe_uninit.rs index e05b40052ee..6661df2ae0d 100644 --- a/src/libcore/mem/maybe_uninit.rs +++ b/src/libcore/mem/maybe_uninit.rs @@ -1,3 +1,5 @@ +use crate::any::type_name; +use crate::fmt; use crate::intrinsics; use crate::mem::ManuallyDrop; @@ -232,6 +234,13 @@ impl Clone for MaybeUninit { } } +#[stable(feature = "maybe_uninit_debug", since = "1.41.0")] +impl fmt::Debug for MaybeUninit { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.pad(type_name::()) + } +} + impl MaybeUninit { /// Creates a new `MaybeUninit` initialized with the given value. /// It is safe to call [`assume_init`] on the return value of this function.