From 8693943676487c01fa09f5f3daf0df6a1f71e24d Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 8 Aug 2013 11:38:10 -0700 Subject: librustc: Ensure that type parameters are in the right positions in paths. This removes the stacking of type parameters that occurs when invoking trait methods, and fixes all places in the standard library that were relying on it. It is somewhat awkward in places; I think we'll probably want something like the `Foo::::new()` syntax. --- src/libstd/fmt/mod.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/libstd/fmt') 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 Poly for T { } } -// n.b. use 'const' to get an implementation for both '*mut' and '*' at the same -// time. -impl Pointer for *const T { - fn fmt(t: &*const T, f: &mut Formatter) { +impl 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 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); -- cgit 1.4.1-3-g733a5