Skip to content

Commit 9ddb45e

Browse files
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: rust-lang/wg-allocators#131
2 parents 44519a3 + c11d46f commit 9ddb45e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/alloc/src/sync.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ impl<T: ?Sized + Unsize<U>, U: ?Sized, A: Allocator> CoerceUnsized<Weak<U, A>> f
335335
impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Weak<U>> for Weak<T> {}
336336

337337
#[stable(feature = "arc_weak", since = "1.4.0")]
338-
impl<T: ?Sized> fmt::Debug for Weak<T> {
338+
impl<T: ?Sized, A: Allocator> fmt::Debug for Weak<T, A> {
339339
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
340340
write!(f, "(Weak)")
341341
}

0 commit comments

Comments
 (0)