From fdae75738b8d9b1df6cf1f24de9a40ac12046dd8 Mon Sep 17 00:00:00 2001 From: Christiaan Dirkx Date: Wed, 21 Apr 2021 14:51:04 +0200 Subject: [PATCH] Change the `Debug` impl of `Any` and `UnsafeCell` to use `finish_non_exhaustive` --- library/core/src/any.rs | 6 +++--- library/core/src/fmt/mod.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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 @@ fn type_id(&self) -> TypeId { #[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 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { #[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 @@ fn fmt(&self, f: &mut Formatter<'_>) -> Result { #[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() } }