about summary refs log tree commit diff
path: root/src/libstd/fmt
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/fmt')
-rw-r--r--src/libstd/fmt/mod.rs15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/libstd/fmt/mod.rs b/src/libstd/fmt/mod.rs
index daf8c4afb07..6d85b968f2a 100644
--- a/src/libstd/fmt/mod.rs
+++ b/src/libstd/fmt/mod.rs
@@ -884,10 +884,17 @@ impl<T> Poly for T {
     }
 }
 
-// n.b. use 'const' to get an implementation for both '*mut' and '*' at the same
-//      time.
-impl<T> Pointer for *const T {
-    fn fmt(t: &*const T, f: &mut Formatter) {
+impl<T> Pointer for *T {
+    fn fmt(t: &*T, f: &mut Formatter) {
+        f.flags |= 1 << (parse::FlagAlternate as uint);
+        do ::uint::to_str_bytes(*t as uint, 16) |buf| {
+            f.pad_integral(buf, "0x", true);
+        }
+    }
+}
+
+impl<T> Pointer for *mut T {
+    fn fmt(t: &*mut T, f: &mut Formatter) {
         f.flags |= 1 << (parse::FlagAlternate as uint);
         do ::uint::to_str_bytes(*t as uint, 16) |buf| {
             f.pad_integral(buf, "0x", true);