Skip to content

Commit 1e8fde0

Browse files
authored
Rollup merge of rust-lang#57703 - m-ou-se:mutexguard-debug, r=cramertj
Make MutexGuard's Debug implementation more useful. Fixes rust-lang#57702.
2 parents 5e6c2f4 + 2e9deed commit 1e8fde0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/libstd/sync/mutex.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -450,9 +450,7 @@ impl<'a, T: ?Sized> Drop for MutexGuard<'a, T> {
450450
#[stable(feature = "std_debug", since = "1.16.0")]
451451
impl<'a, T: ?Sized + fmt::Debug> fmt::Debug for MutexGuard<'a, T> {
452452
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
453-
f.debug_struct("MutexGuard")
454-
.field("lock", &self.__lock)
455-
.finish()
453+
fmt::Debug::fmt(&**self, f)
456454
}
457455
}
458456

0 commit comments

Comments
 (0)