about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorCorey Richardson <corey@octayn.net>2014-02-15 00:10:31 -0500
committerCorey Richardson <corey@octayn.net>2014-02-15 12:11:50 -0500
commit254c155fca415359d998e79e9989b4219136ccdc (patch)
tree140a8db85290ea4248547d59a3c2aa800e50c296 /src/libstd
parent49e11630fa84eefc27a34c39ad28a9afb515c5a1 (diff)
downloadrust-254c155fca415359d998e79e9989b4219136ccdc.tar.gz
rust-254c155fca415359d998e79e9989b4219136ccdc.zip
impl fmt::Pointer for &T and &mut T
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/fmt/mod.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/libstd/fmt/mod.rs b/src/libstd/fmt/mod.rs
index c8b5d3b2d5a..cfcb467d7aa 100644
--- a/src/libstd/fmt/mod.rs
+++ b/src/libstd/fmt/mod.rs
@@ -1200,7 +1200,17 @@ impl<T> Pointer for *T {
 }
 impl<T> Pointer for *mut T {
     fn fmt(&self, f: &mut Formatter) -> Result {
-        secret_pointer(&(*self as *T), f)
+        secret_pointer::<*T>(&(*self as *T), f)
+    }
+}
+impl<'a, T> Pointer for &'a T {
+    fn fmt(&self, f: &mut Formatter) -> Result {
+        secret_pointer::<*T>(&(&**self as *T), f)
+    }
+}
+impl<'a, T> Pointer for &'a mut T {
+    fn fmt(&self, f: &mut Formatter) -> Result {
+        secret_pointer::<*T>(&(&**self as *T), f)
     }
 }