Skip to content

Commit 99a5715

Browse files
committed
syntax: Pretty print impls with new syntax
1 parent 436a90e commit 99a5715

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/libsyntax/print/pprust.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -496,19 +496,20 @@ fn print_item(s: ps, &&item: @ast::item) {
496496
}
497497
ast::item_impl(tps, traits, ty, methods) => {
498498
head(s, ~"impl");
499-
word(s.s, *item.ident);
500-
print_type_params(s, tps);
501-
space(s.s);
499+
if tps.is_not_empty() {
500+
print_type_params(s, tps);
501+
space(s.s);
502+
}
503+
print_type(s, ty);
504+
502505
if vec::len(traits) != 0u {
503-
word_nbsp(s, ~"of");
506+
word_space(s, ~":");
504507
do commasep(s, inconsistent, traits) |s, p| {
505508
print_path(s, p.path, false);
506509
}
507-
space(s.s);
508510
}
509-
word_nbsp(s, ~"for");
510-
print_type(s, ty);
511511
space(s.s);
512+
512513
bopen(s);
513514
for methods.each |meth| {
514515
print_method(s, meth);

0 commit comments

Comments
 (0)