diff options
| author | Marijn Haverbeke <marijnh@gmail.com> | 2012-01-06 10:36:55 +0100 |
|---|---|---|
| committer | Marijn Haverbeke <marijnh@gmail.com> | 2012-01-06 17:40:05 +0100 |
| commit | 41a2d8495e3784a03871b69d686f4937c8396707 (patch) | |
| tree | 75f581e57a08d6ecd4c1dac08e1384480386825a /src/comp/syntax | |
| parent | 7c1f683c6d93cdb5fee8a664cd6b5ff2397e1d04 (diff) | |
| download | rust-41a2d8495e3784a03871b69d686f4937c8396707.tar.gz rust-41a2d8495e3784a03871b69d686f4937c8396707.zip | |
Fix pretty-printing of ty params in iface methods
Diffstat (limited to 'src/comp/syntax')
| -rw-r--r-- | src/comp/syntax/print/pprust.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/comp/syntax/print/pprust.rs b/src/comp/syntax/print/pprust.rs index e1a0151a627..3e9eab79281 100644 --- a/src/comp/syntax/print/pprust.rs +++ b/src/comp/syntax/print/pprust.rs @@ -306,7 +306,7 @@ fn print_type(s: ps, &&ty: @ast::ty) { pclose(s); } ast::ty_fn(proto, d) { - print_ty_fn(s, proto, d, none::<str>); + print_ty_fn(s, proto, d, none, none); } ast::ty_obj(methods) { head(s, "obj"); @@ -519,7 +519,7 @@ fn print_ty_method(s: ps, m: ast::ty_method) { hardbreak_if_not_bol(s); cbox(s, indent_unit); maybe_print_comment(s, m.span.lo); - print_ty_fn(s, ast::proto_bare, m.decl, some(m.ident)); + print_ty_fn(s, ast::proto_bare, m.decl, some(m.ident), some(m.tps)); word(s.s, ";"); end(s); } @@ -1399,10 +1399,12 @@ fn print_mt(s: ps, mt: ast::mt) { } fn print_ty_fn(s: ps, proto: ast::proto, - decl: ast::fn_decl, id: option::t<ast::ident>) { + decl: ast::fn_decl, id: option::t<ast::ident>, + tps: option::t<[ast::ty_param]>) { ibox(s, indent_unit); word(s.s, proto_to_str(proto)); alt id { some(id) { word(s.s, " "); word(s.s, id); } _ { } } + alt tps { some(tps) { print_type_params(s, tps); } _ { } } zerobreak(s.s); popen(s); fn print_arg(s: ps, input: ast::arg) { |
