diff --git a/src/lib.rs b/src/lib.rs index 521692b6d3..bb6e38cd7f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,7 +23,7 @@ pub enum TableKind { } /// Physical memory address -#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] +#[derive(Clone, Copy, Eq, Hash, Ord, PartialEq, PartialOrd)] #[repr(transparent)] pub struct PhysicalAddress(usize); @@ -44,6 +44,12 @@ impl PhysicalAddress { } } +impl core::fmt::Debug for PhysicalAddress { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "[phys {:#0x}]", self.data()) + } +} + /// Virtual memory address #[derive(Clone, Copy, Eq, Hash, Ord, PartialEq, PartialOrd)] #[repr(transparent)] @@ -74,6 +80,7 @@ impl VirtualAddress { } } } + impl core::fmt::Debug for VirtualAddress { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { write!(f, "[virt {:#0x}]", self.data())