Auto merge of #22573 - nwin:impl-debug-rwlock-weak, r=Manishearth
Implements `Debug` for `RwLock` and `arc::Weak` in the same way it is implemented for `rc::Weak` (basically copy & paste). The lack of this implementation prevents the automatic implementation of `Debug` for structs containing members of these types.
This commit is contained in:
@@ -139,6 +139,13 @@ pub struct Weak<T> {
|
||||
unsafe impl<T: Sync + Send> Send for Weak<T> { }
|
||||
unsafe impl<T: Sync + Send> Sync for Weak<T> { }
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: fmt::Debug> fmt::Debug for Weak<T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "(Weak)")
|
||||
}
|
||||
}
|
||||
|
||||
struct ArcInner<T> {
|
||||
strong: atomic::AtomicUsize,
|
||||
weak: atomic::AtomicUsize,
|
||||
|
||||
Reference in New Issue
Block a user