MutexGuard's Debug implementation just forwards to the Mutex's Debug implementation, which will simply print <locked>, because the Mutex was locked (by that very same MutexGuard).
Effectively, this means that the current Debug implementation of MutexGuard is equivalent to:
f.write_str("MutexGuard { lock: Mutex { data: <locked> } }")
Instead, it should not try to lock the mutex, but use its own Deref implementation to print the contents of the mutex.
MutexGuard'sDebugimplementation just forwards to theMutex'sDebugimplementation, which will simply print<locked>, because theMutexwas locked (by that very sameMutexGuard).Effectively, this means that the current
Debugimplementation ofMutexGuardis equivalent to:Instead, it should not try to lock the mutex, but use its own
Derefimplementation to print the contents of the mutex.