From 41a2d8495e3784a03871b69d686f4937c8396707 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Fri, 6 Jan 2012 10:36:55 +0100 Subject: [PATCH] Fix pretty-printing of ty params in iface methods --- src/comp/syntax/print/pprust.rs | 8 +++++--- src/test/run-pass/iface-generic.rs | 2 -- 2 files changed, 5 insertions(+), 5 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::); + 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) { + decl: ast::fn_decl, id: option::t, + 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) { diff --git a/src/test/run-pass/iface-generic.rs b/src/test/run-pass/iface-generic.rs index 4ac80490b78..2286642cda1 100644 --- a/src/test/run-pass/iface-generic.rs +++ b/src/test/run-pass/iface-generic.rs @@ -1,5 +1,3 @@ -// xfail-pretty - iface to_str { fn to_str() -> str; }