Rollup merge of #57703 - m-ou-se:mutexguard-debug, r=cramertj

Make MutexGuard's Debug implementation more useful.

Fixes #57702.
This commit is contained in:
Mazdak Farrokhzad 2019-01-26 18:21:42 +01:00 committed by GitHub
commit 1e8fde07b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -450,9 +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 {
f.debug_struct("MutexGuard")
.field("lock", &self.__lock)
.finish()
fmt::Debug::fmt(&**self, f)
}
}