Change the Debug impl of Any and UnsafeCell to use finish_non_exhaustive

This commit is contained in:
Christiaan Dirkx 2021-04-21 14:51:04 +02:00
parent 1fb3256fcb
commit fdae75738b
2 changed files with 4 additions and 4 deletions

View File

@ -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()
}
}

View File

@ -2270,7 +2270,7 @@ fn fmt(&self, f: &mut Formatter<'_>) -> Result {
#[stable(feature = "core_impl_debug", since = "1.9.0")]
impl<T: ?Sized> Debug for UnsafeCell<T> {
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
f.debug_struct("UnsafeCell").finish()
f.debug_struct("UnsafeCell").finish_non_exhaustive()
}
}