mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Make tagged pointers debug impls print the pointer
Does not really matter, but may be nicer in case the pointer has some specific debug impl.
This commit is contained in:
parent
c6acd5c92f
commit
c7c0b85f67
@ -163,15 +163,13 @@ where
|
||||
|
||||
impl<P, T, const COMPARE_PACKED: bool> fmt::Debug for CopyTaggedPtr<P, T, COMPARE_PACKED>
|
||||
where
|
||||
P: Pointer,
|
||||
P::Target: fmt::Debug,
|
||||
P: Pointer + fmt::Debug,
|
||||
T: Tag + fmt::Debug,
|
||||
{
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("CopyTaggedPtr")
|
||||
.field("pointer", &self.pointer_ref())
|
||||
.field("tag", &self.tag())
|
||||
.finish()
|
||||
self.with_pointer_ref(|ptr| {
|
||||
f.debug_struct("CopyTaggedPtr").field("pointer", ptr).field("tag", &self.tag()).finish()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -85,15 +85,13 @@ where
|
||||
|
||||
impl<P, T, const COMPARE_PACKED: bool> fmt::Debug for TaggedPtr<P, T, COMPARE_PACKED>
|
||||
where
|
||||
P: Pointer,
|
||||
P::Target: fmt::Debug,
|
||||
P: Pointer + fmt::Debug,
|
||||
T: Tag + fmt::Debug,
|
||||
{
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("TaggedPtr")
|
||||
.field("pointer", &self.pointer_ref())
|
||||
.field("tag", &self.tag())
|
||||
.finish()
|
||||
self.raw.with_pointer_ref(|ptr| {
|
||||
f.debug_struct("TaggedPtr").field("pointer", ptr).field("tag", &self.tag()).finish()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user