summary refs log tree commit diff
path: root/src/libsyntax/print
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-08-08 16:26:10 -0700
committerBrian Anderson <banderson@mozilla.com>2012-08-08 18:19:26 -0700
commit99a571585c47dd90badb44d366c9ff4d2c43b296 (patch)
tree947d31390a056cfa58b23a6f402098094ca68ada /src/libsyntax/print
parent436a90e3d78a81379e36c8acec49e170bb1cd0e6 (diff)
downloadrust-99a571585c47dd90badb44d366c9ff4d2c43b296.tar.gz
rust-99a571585c47dd90badb44d366c9ff4d2c43b296.zip
syntax: Pretty print impls with new syntax
Diffstat (limited to 'src/libsyntax/print')
-rw-r--r--src/libsyntax/print/pprust.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index 7a20dc1d3be..60c310100a1 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -496,19 +496,20 @@ fn print_item(s: ps, &&item: @ast::item) {
       }
       ast::item_impl(tps, traits, ty, methods) => {
         head(s, ~"impl");
-        word(s.s, *item.ident);
-        print_type_params(s, tps);
-        space(s.s);
+        if tps.is_not_empty() {
+            print_type_params(s, tps);
+            space(s.s);
+        }
+        print_type(s, ty);
+
         if vec::len(traits) != 0u {
-            word_nbsp(s, ~"of");
+            word_space(s, ~":");
             do commasep(s, inconsistent, traits) |s, p| {
                 print_path(s, p.path, false);
             }
-            space(s.s);
         }
-        word_nbsp(s, ~"for");
-        print_type(s, ty);
         space(s.s);
+
         bopen(s);
         for methods.each |meth| {
            print_method(s, meth);