diff --git a/library/core/src/any.rs b/library/core/src/any.rs index 339e874558c..5e1725cfc7a 100644 --- a/library/core/src/any.rs +++ b/library/core/src/any.rs @@ -141,7 +141,7 @@ impl Any for T { #[stable(feature = "rust1", since = "1.0.0")] impl fmt::Debug for dyn Any { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Any").finish() + f.debug_struct("Any").finish_non_exhaustive() } } @@ -151,14 +151,14 @@ impl fmt::Debug for dyn Any { #[stable(feature = "rust1", since = "1.0.0")] impl fmt::Debug for dyn Any + Send { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Any").finish() + f.debug_struct("Any").finish_non_exhaustive() } } #[stable(feature = "any_send_sync_methods", since = "1.28.0")] impl fmt::Debug for dyn Any + Send + Sync { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Any").finish() + f.debug_struct("Any").finish_non_exhaustive() } } diff --git a/library/core/src/fmt/mod.rs b/library/core/src/fmt/mod.rs index 0edb7da5717..87042d95fbe 100644 --- a/library/core/src/fmt/mod.rs +++ b/library/core/src/fmt/mod.rs @@ -2270,7 +2270,7 @@ impl Debug for RefMut<'_, T> { #[stable(feature = "core_impl_debug", since = "1.9.0")] impl Debug for UnsafeCell { fn fmt(&self, f: &mut Formatter<'_>) -> Result { - f.debug_struct("UnsafeCell").finish() + f.debug_struct("UnsafeCell").finish_non_exhaustive() } }