Skip to content

Commit 65b16e7

Browse files
committed
---
yaml --- r: 3663 b: refs/heads/master c: f164d77 h: refs/heads/master i: 3661: e62faf6 3659: dfba33d 3655: 9fd1a62 3647: 7f9f5ce v: v3
1 parent dd81110 commit 65b16e7

File tree

5 files changed

+18
-17
lines changed

5 files changed

+18
-17
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: c83782f5008b366191ddf8f6f820b49a23eaadcd
2+
refs/heads/master: f164d7779aea578dfadf22146e294e0fcd142796

trunk/src/comp/syntax/ast.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ type ty_method_ =
337337
ty_arg[] inputs,
338338
@ty output,
339339
controlflow cf,
340-
vec[@constr] constrs);
340+
(@constr)[] constrs);
341341
342342
type ty_field = spanned[ty_field_];
343343
@@ -403,11 +403,11 @@ tag ty_ {
403403
ty_chan(@ty);
404404
ty_tup(mt[]);
405405
ty_rec(ty_field[]);
406-
ty_fn(proto, ty_arg[], @ty, controlflow, vec[@constr]);
406+
ty_fn(proto, ty_arg[], @ty, controlflow, (@constr)[]);
407407
ty_obj(ty_method[]);
408408
ty_path(path, node_id);
409409
ty_type;
410-
ty_constr(@ty, vec[@constr]);
410+
ty_constr(@ty, (@constr)[]);
411411
}
412412

413413

@@ -442,7 +442,7 @@ type fn_decl =
442442
@ty output,
443443
purity purity,
444444
controlflow cf,
445-
vec[@constr] constraints);
445+
(@constr)[] constraints);
446446

447447
tag purity {
448448
pure_fn; // declared with "pred"

trunk/src/comp/syntax/fold.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ fn noop_fold_native_item(&@native_item ni, ast_fold fld) -> @native_item {
175175
rec(inputs=map(fold_arg, fdec.inputs),
176176
output=fld.fold_ty(fdec.output),
177177
purity=fdec.purity, cf=fdec.cf,
178-
constraints=map(fld.fold_constr,
179-
fdec.constraints)),
178+
constraints=ivec::map(fld.fold_constr,
179+
fdec.constraints)),
180180
typms)
181181
}
182182
},
@@ -450,11 +450,12 @@ fn noop_fold_constr(&constr_ c, ast_fold fld) -> constr_ {
450450
fn noop_fold_fn(&_fn f, ast_fold fld) -> _fn {
451451
auto fold_arg = bind fold_arg_(_, fld);
452452

453-
ret rec(decl= rec(inputs=map(fold_arg, f.decl.inputs),
453+
ret rec(decl= rec(inputs=vec::map(fold_arg, f.decl.inputs),
454454
output=fld.fold_ty(f.decl.output),
455455
purity=f.decl.purity,
456456
cf=f.decl.cf,
457-
constraints=map(fld.fold_constr, f.decl.constraints)),
457+
constraints=ivec::map(fld.fold_constr,
458+
f.decl.constraints)),
458459
proto = f.proto,
459460
body = fld.fold_block(f.body));
460461
}

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -363,17 +363,17 @@ fn parse_ty_constr(&vec[ast::arg] fn_args, &parser p) -> @ast::constr {
363363
// Use the args list to translate each bound variable
364364
// mentioned in a constraint to an arg index.
365365
// Seems weird to do this in the parser, but I'm not sure how else to.
366-
fn parse_constrs(&vec[ast::arg] args, &parser p) ->
367-
ast::spanned[vec[@ast::constr]] {
366+
fn parse_constrs(&vec[ast::arg] args, &parser p)
367+
-> ast::spanned[(@ast::constr)[]] {
368368
auto lo = p.get_lo_pos();
369369
auto hi = p.get_hi_pos();
370-
let vec[@ast::constr] constrs = [];
370+
let (@ast::constr)[] constrs = ~[];
371371
if (p.peek() == token::COLON) {
372372
p.bump();
373373
while (true) {
374374
auto constr = parse_ty_constr(args, p);
375375
hi = constr.span.hi;
376-
vec::push(constrs, constr);
376+
constrs += ~[constr];
377377
if (p.peek() == token::COMMA) { p.bump(); } else { break; }
378378
}
379379
}
@@ -1799,7 +1799,7 @@ fn parse_dtor(&parser p) -> @ast::method {
17991799
cf=ast::return,
18001800

18011801
// I guess dtors can't have constraints?
1802-
constraints=[]);
1802+
constraints=~[]);
18031803
let ast::_fn f = rec(decl=d, proto=ast::proto_fn, body=b);
18041804
let ast::method_ m =
18051805
rec(ident="drop", meth=f, id=p.get_id());
@@ -1844,7 +1844,7 @@ fn parse_item_res(&parser p, ast::layer lyr, &ast::attribute[] attrs) ->
18441844
output=@spanned(lo, lo, ast::ty_nil),
18451845
purity=ast::impure_fn,
18461846
cf=ast::return,
1847-
constraints=[]);
1847+
constraints=~[]);
18481848
auto f = rec(decl=decl, proto=ast::proto_fn, body=dtor);
18491849
ret mk_item(p, lo, dtor.span.hi, ident,
18501850
ast::item_res(f, p.get_id(), ty_params, p.get_id()), attrs);

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1235,7 +1235,7 @@ fn print_mt(&ps s, &ast::mt mt) {
12351235

12361236
fn print_ty_fn(&ps s, &ast::proto proto, &option::t[str] id,
12371237
&ast::ty_arg[] inputs, &@ast::ty output,
1238-
&ast::controlflow cf, &vec[@ast::constr] constrs) {
1238+
&ast::controlflow cf, &(@ast::constr)[] constrs) {
12391239
ibox(s, indent_unit);
12401240
if (proto == ast::proto_fn) {
12411241
word(s.s, "fn");
@@ -1488,7 +1488,7 @@ fn ast_constr_to_str(&@ast::constr c) -> str {
14881488
constr_args_to_str(uint_to_str, cag_ivec);
14891489
}
14901490
1491-
fn ast_constrs_str(&vec[@ast::constr] constrs) -> str {
1491+
fn ast_constrs_str(&(@ast::constr)[] constrs) -> str {
14921492
auto s = "";
14931493
auto colon = true;
14941494
for (@ast::constr c in constrs) {

0 commit comments

Comments
 (0)