Closed
Description
I'm fairly new to Rust so I'm not sure if this is intended, but I am running into this issue while storing a Weak inside a derive(Debug) struct. I checked the Rust source and found this line:
#[stable(feature = "arc_weak", since = "1.4.0")]
impl<T: ?Sized> fmt::Debug for Weak<T> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "(Weak)")
}
}
However, this only implements Debug for Weak, not Weak<T, A>.
Should this be changed to say Weak<T, A> instead? I'm happy to make a PR to rust-lang that changes it to:
#[stable(feature = "arc_weak", since = "1.4.0")]
impl<T: ?Sized, A: Allocator> fmt::Debug for Weak<T, A> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "(Weak)")
}
}
Additionally, though out of the scope of this issue, is there a good reason that this debug function does not try to display the Option that it implicitly contains?
Metadata
Metadata
Assignees
Labels
No labels