mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-10 14:57:14 +00:00
Pretty-print kinds of type params
This commit is contained in:
parent
843767a841
commit
0b7a94a94c
@ -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);
|
||||
|
@ -1,5 +1,3 @@
|
||||
// xfail-pretty
|
||||
|
||||
fn swap[@T](v: &vec[mutable T], i: int, j: int) { v.(i) <-> v.(j); }
|
||||
|
||||
fn main() {
|
||||
|
Loading…
Reference in New Issue
Block a user