Skip to content

Commit e62faf6

Browse files
committed
---
yaml --- r: 3661 b: refs/heads/master c: aad0bcc h: refs/heads/master i: 3659: dfba33d v: v3
1 parent 09e6486 commit e62faf6

File tree

5 files changed

+6
-10
lines changed

5 files changed

+6
-10
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 401b6362d7f99a3cebc863cb1b8906d62e9ba79b
2+
refs/heads/master: aad0bcc8d5e1ed9cf6ca0eedae21b3aa0c67ab16

trunk/src/comp/middle/typeck.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -315,11 +315,7 @@ fn ast_ty_to_ty(&ty::ctxt tcx, &ty_getter getter, &@ast::ty ast_ty) -> ty::t {
315315
typ = ty::mk_chan(tcx, ast_ty_to_ty(tcx, getter, t));
316316
}
317317
case (ast::ty_tup(?fields)) {
318-
let ty::mt[] flds = ~[];
319-
ivec::reserve(flds, vec::len(fields));
320-
for (ast::mt field in fields) {
321-
flds += ~[ast_mt_to_mt(tcx, getter, field)];
322-
}
318+
auto flds = ivec::map(bind ast_mt_to_mt(tcx, getter, _), fields);
323319
typ = ty::mk_tup(tcx, flds);
324320
}
325321
case (ast::ty_rec(?fields)) {

trunk/src/comp/syntax/ast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ tag ty_ {
401401
ty_task;
402402
ty_port(@ty);
403403
ty_chan(@ty);
404-
ty_tup(vec[mt]);
404+
ty_tup(mt[]);
405405
ty_rec(vec[ty_field]);
406406
ty_fn(proto, vec[ty_arg], @ty, controlflow, vec[@constr]);
407407
ty_obj(vec[ty_method]);

trunk/src/comp/syntax/parse/parser.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,8 @@ fn parse_ty(&parser p) -> @ast::ty {
520520
expect(p, token::RBRACKET);
521521
} else if (eat_word(p, "tup")) {
522522
auto elems =
523-
parse_seq(token::LPAREN, token::RPAREN, some(token::COMMA),
524-
parse_mt, p);
523+
parse_seq_ivec(token::LPAREN, token::RPAREN, some(token::COMMA),
524+
parse_mt, p);
525525
hi = elems.span.hi;
526526
t = ast::ty_tup(elems.node);
527527
} else if (eat_word(p, "rec")) {

trunk/src/comp/syntax/print/pprust.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ fn print_type(&ps s, &ast::ty ty) {
301301
case (ast::ty_tup(?elts)) {
302302
word(s.s, "tup");
303303
popen(s);
304-
commasep(s, inconsistent, elts, print_mt);
304+
commasep_ivec(s, inconsistent, elts, print_mt);
305305
pclose(s);
306306
}
307307
case (ast::ty_rec(?fields)) {

0 commit comments

Comments
 (0)