diff options
| author | Jubilee <workingjubilee@gmail.com> | 2024-08-28 19:12:54 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-28 19:12:54 -0700 |
| commit | 9ddb45e81afa405ceb11f34f6276332ce8d0ef55 (patch) | |
| tree | c42b238f7d1781ecb37ae82afbb77cd39a28d4ef /library/alloc | |
| parent | 44519a371b1eebde7ee00dc654d47fd66e6f9e0f (diff) | |
| parent | c11d46f045815a346533f36914876a5c01a9f658 (diff) | |
| download | rust-9ddb45e81afa405ceb11f34f6276332ce8d0ef55.tar.gz rust-9ddb45e81afa405ceb11f34f6276332ce8d0ef55.zip | |
Rollup merge of #129673 - matthewpipie:arc-weak-debug-trait, r=dtolnay
Add fmt::Debug to sync::Weak<T, A> Currently, `sync::Weak<T>` implements `Debug`, but `sync::Weak<T, A>` does not. This appears to be an oversight, as `rc::Weak<T, A>` implements `Debug`. (Note: `sync::Weak` is the weak for `Arc`, and `rc::Weak` is the weak for `Rc`.) This PR adds the Debug trait for `sync::Weak<T, A>`. The issue was initially brought up here: https://github.com/rust-lang/wg-allocators/issues/131
Diffstat (limited to 'library/alloc')
| -rw-r--r-- | library/alloc/src/sync.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index aac768eb053..024a794f17b 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -335,7 +335,7 @@ impl<T: ?Sized + Unsize<U>, U: ?Sized, A: Allocator> CoerceUnsized<Weak<U, A>> f impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Weak<U>> for Weak<T> {} #[stable(feature = "arc_weak", since = "1.4.0")] -impl<T: ?Sized> fmt::Debug for Weak<T> { +impl<T: ?Sized, A: Allocator> fmt::Debug for Weak<T, A> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "(Weak)") } |
