diff options
| author | Corey Richardson <corey@octayn.net> | 2014-02-15 00:10:31 -0500 |
|---|---|---|
| committer | Corey Richardson <corey@octayn.net> | 2014-02-15 12:11:50 -0500 |
| commit | 254c155fca415359d998e79e9989b4219136ccdc (patch) | |
| tree | 140a8db85290ea4248547d59a3c2aa800e50c296 /src/libstd | |
| parent | 49e11630fa84eefc27a34c39ad28a9afb515c5a1 (diff) | |
| download | rust-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.rs | 12 |
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) } } |
