rustc: Make AST tuple types use interior vectors
This commit is contained in:
parent
401b6362d7
commit
aad0bcc8d5
4 changed files with 5 additions and 9 deletions
|
@ -315,11 +315,7 @@ fn ast_ty_to_ty(&ty::ctxt tcx, &ty_getter getter, &@ast::ty ast_ty) -> ty::t {
|
|||
typ = ty::mk_chan(tcx, ast_ty_to_ty(tcx, getter, t));
|
||||
}
|
||||
case (ast::ty_tup(?fields)) {
|
||||
let ty::mt[] flds = ~[];
|
||||
ivec::reserve(flds, vec::len(fields));
|
||||
for (ast::mt field in fields) {
|
||||
flds += ~[ast_mt_to_mt(tcx, getter, field)];
|
||||
}
|
||||
auto flds = ivec::map(bind ast_mt_to_mt(tcx, getter, _), fields);
|
||||
typ = ty::mk_tup(tcx, flds);
|
||||
}
|
||||
case (ast::ty_rec(?fields)) {
|
||||
|
|
|
@ -401,7 +401,7 @@ tag ty_ {
|
|||
ty_task;
|
||||
ty_port(@ty);
|
||||
ty_chan(@ty);
|
||||
ty_tup(vec[mt]);
|
||||
ty_tup(mt[]);
|
||||
ty_rec(vec[ty_field]);
|
||||
ty_fn(proto, vec[ty_arg], @ty, controlflow, vec[@constr]);
|
||||
ty_obj(vec[ty_method]);
|
||||
|
|
|
@ -520,7 +520,7 @@ fn parse_ty(&parser p) -> @ast::ty {
|
|||
expect(p, token::RBRACKET);
|
||||
} else if (eat_word(p, "tup")) {
|
||||
auto elems =
|
||||
parse_seq(token::LPAREN, token::RPAREN, some(token::COMMA),
|
||||
parse_seq_ivec(token::LPAREN, token::RPAREN, some(token::COMMA),
|
||||
parse_mt, p);
|
||||
hi = elems.span.hi;
|
||||
t = ast::ty_tup(elems.node);
|
||||
|
|
|
@ -301,7 +301,7 @@ fn print_type(&ps s, &ast::ty ty) {
|
|||
case (ast::ty_tup(?elts)) {
|
||||
word(s.s, "tup");
|
||||
popen(s);
|
||||
commasep(s, inconsistent, elts, print_mt);
|
||||
commasep_ivec(s, inconsistent, elts, print_mt);
|
||||
pclose(s);
|
||||
}
|
||||
case (ast::ty_rec(?fields)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue