diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 4e9123fec9767..261291b747f89 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -2346,7 +2346,7 @@ pub struct Unique { #[unstable(feature = "ptr_internals", issue = "0")] impl fmt::Debug for Unique { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{:p}", self.as_ptr()) + fmt::Pointer::fmt(&self.as_ptr(), f) } } @@ -2489,7 +2489,7 @@ pub struct NonNull { #[stable(feature = "nonnull", since = "1.24.0")] impl fmt::Debug for NonNull { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{:p}", self.as_ptr()) + fmt::Pointer::fmt(&self.as_ptr(), f) } }