diff options
| author | Richo Healey <richo@psych0tik.net> | 2015-04-07 00:40:22 -0700 |
|---|---|---|
| committer | Richo Healey <richo@psych0tik.net> | 2015-04-07 22:50:36 -0700 |
| commit | a329a61b9bf01bfc3f9f7316bb800b2bc8b76382 (patch) | |
| tree | 2c46d4e549d500b30787bfd9d16481f6cbef1849 /src/libcore/ptr.rs | |
| parent | b2e65ee6e4e1523b1d4c56ea0ec430e28946f2f4 (diff) | |
| download | rust-a329a61b9bf01bfc3f9f7316bb800b2bc8b76382.tar.gz rust-a329a61b9bf01bfc3f9f7316bb800b2bc8b76382.zip | |
alloc: impl fmt::Pointer for Rc, Arc and Box
Closes #24091
Diffstat (limited to 'src/libcore/ptr.rs')
| -rw-r--r-- | src/libcore/ptr.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index ff51e25fcbf..36b33e7581d 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -94,6 +94,7 @@ use mem; use clone::Clone; use intrinsics; use ops::Deref; +use core::fmt; use option::Option::{self, Some, None}; use marker::{PhantomData, Send, Sized, Sync}; use nonzero::NonZero; @@ -570,3 +571,10 @@ impl<T:?Sized> Deref for Unique<T> { unsafe { mem::transmute(&*self.pointer) } } } + +#[stable(feature = "rust1", since = "1.0.0")] +impl<T> fmt::Pointer for Unique<T> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Pointer::fmt(&*self.pointer, f) + } +} |
