Pretty-print kinds of type params

This commit is contained in:
Brian Anderson 2011-08-02 21:26:54 -07:00
parent 843767a841
commit 0b7a94a94c
2 changed files with 9 additions and 2 deletions

View File

@ -1195,10 +1195,19 @@ fn print_alias(s: &ps, m: ast::mode) {
}
}
fn print_kind(s: &ps, kind: ast::kind) {
alt kind {
ast::kind_unique. { word(s.s, "~"); }
ast::kind_shared. { word(s.s, "@"); }
_ { /* fallthrough */ }
}
}
fn print_type_params(s: &ps, params: &ast::ty_param[]) {
if ivec::len(params) > 0u {
word(s.s, "[");
fn printParam(s: &ps, param: &ast::ty_param) {
print_kind(s, param.kind);
word(s.s, param.ident);
}
commasep(s, inconsistent, params, printParam);

View File

@ -1,5 +1,3 @@
// xfail-pretty
fn swap[@T](v: &vec[mutable T], i: int, j: int) { v.(i) <-> v.(j); }
fn main() {