diff options
| author | Simon Sapin <simon.sapin@exyr.org> | 2018-01-10 09:21:15 +0100 |
|---|---|---|
| committer | Simon Sapin <simon.sapin@exyr.org> | 2018-01-20 11:09:23 +0100 |
| commit | a1db237cd48e9218f1ea5915c8fd2132dd72358e (patch) | |
| tree | aa76998d6208f2358ab5315686c17078a4b7e094 /src/libcore/ptr.rs | |
| parent | 943a9e707c25380c48d2227224b89385b3004ef6 (diff) | |
| download | rust-a1db237cd48e9218f1ea5915c8fd2132dd72358e.tar.gz rust-a1db237cd48e9218f1ea5915c8fd2132dd72358e.zip | |
Preserve formatting options in Debug for NonNull/Unique
Diffstat (limited to 'src/libcore/ptr.rs')
| -rw-r--r-- | src/libcore/ptr.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 4e9123fec97..261291b747f 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -2346,7 +2346,7 @@ pub struct Unique<T: ?Sized> { #[unstable(feature = "ptr_internals", issue = "0")] impl<T: ?Sized> fmt::Debug for Unique<T> { 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<T: ?Sized> { #[stable(feature = "nonnull", since = "1.24.0")] impl<T: ?Sized> fmt::Debug for NonNull<T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{:p}", self.as_ptr()) + fmt::Pointer::fmt(&self.as_ptr(), f) } } |
