diff --git a/src/libstd/fmt/mod.rs b/src/libstd/fmt/mod.rs index c8b5d3b2d5a4..cfcb467d7aa6 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) } }