about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/sync/mutex.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs
index e4cc2979207..59829db23cb 100644
--- a/src/libstd/sync/mutex.rs
+++ b/src/libstd/sync/mutex.rs
@@ -450,13 +450,7 @@ impl<'a, T: ?Sized> Drop for MutexGuard<'a, T> {
 #[stable(feature = "std_debug", since = "1.16.0")]
 impl<'a, T: ?Sized + fmt::Debug> fmt::Debug for MutexGuard<'a, T> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        struct MutexFmt<'a, T: ?Sized>(&'a MutexGuard<'a, T>);
-        impl<'a, T: ?Sized + fmt::Debug> fmt::Debug for MutexFmt<'a, T> {
-            fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-                f.debug_struct("Mutex").field("data", &&*self.0).finish()
-            }
-        }
-        f.debug_struct("MutexGuard").field("lock", &MutexFmt(self)).finish()
+        fmt::Debug::fmt(&**self, f)
     }
 }