about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-04-08 22:08:31 +0000
committerbors <bors@rust-lang.org>2015-04-08 22:08:31 +0000
commit6436e348e97a09c2155d0dcd710416e6e0d84371 (patch)
tree592eb6fa4567c7b29cd90c17c370d0fa0f692cf7 /src/libcore
parentff804778c8d69d7835cf7076886ac5dac9a39659 (diff)
parenta329a61b9bf01bfc3f9f7316bb800b2bc8b76382 (diff)
downloadrust-6436e348e97a09c2155d0dcd710416e6e0d84371.tar.gz
rust-6436e348e97a09c2155d0dcd710416e6e0d84371.zip
Auto merge of #24144 - richo:ptr-formatter, r=alexcrichton
~~I believe this should fix the issue. Opening a PR to ensure noone duplicates effort, I'm running check now.~~

Closes #24091
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/ptr.rs8
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)
+    }
+}