impl fmt::Pointer for &T and &mut T

This commit is contained in:
Corey Richardson 2014-02-15 00:10:31 -05:00
parent 49e11630fa
commit 254c155fca

View File

@ -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)
}
}