From 254c155fca415359d998e79e9989b4219136ccdc Mon Sep 17 00:00:00 2001 From: Corey Richardson Date: Sat, 15 Feb 2014 00:10:31 -0500 Subject: impl fmt::Pointer for &T and &mut T --- src/libstd/fmt/mod.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/libstd') 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 Pointer for *T { } impl 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) } } -- cgit 1.4.1-3-g733a5