Skip to content

Commit 702f88a

Browse files
committed
rustc: Move tstate::annotate over to interior vectors
1 parent 4c38430 commit 702f88a

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/comp/middle/tstate/annotate.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,36 +24,36 @@ import aux::crate_ctxt;
2424
import aux::add_node;
2525
import middle::tstate::ann::empty_ann;
2626

27-
fn collect_ids_expr(&@expr e, @mutable vec[node_id] rs) {
28-
vec::push(*rs, e.id);
27+
fn collect_ids_expr(&@expr e, @mutable node_id[] rs) {
28+
*rs += ~[e.id];
2929
}
3030

31-
fn collect_ids_block(&block b, @mutable vec[node_id] rs) {
32-
vec::push(*rs, b.node.id);
31+
fn collect_ids_block(&block b, @mutable node_id[] rs) {
32+
*rs += ~[b.node.id];
3333
}
3434

35-
fn collect_ids_stmt(&@stmt s, @mutable vec[node_id] rs) {
35+
fn collect_ids_stmt(&@stmt s, @mutable node_id[] rs) {
3636
alt (s.node) {
3737
case (stmt_decl(_, ?id)) {
3838
log "node_id " + int::str(id);
3939
log_stmt(*s);
40-
vec::push(*rs, id);
40+
*rs += ~[id];
4141
}
4242
case (stmt_expr(_, ?id)) {
4343
log "node_id " + int::str(id);
4444
log_stmt(*s);
45-
vec::push(*rs, id);
45+
*rs += ~[id];
4646
}
4747
case (_) { }
4848
}
4949
}
5050

51-
fn collect_ids_local(&@local l, @mutable vec[node_id] rs) {
52-
vec::push(*rs, l.node.id);
51+
fn collect_ids_local(&@local l, @mutable node_id[] rs) {
52+
*rs += ~[l.node.id];
5353
}
5454

5555
fn node_ids_in_fn(&_fn f, &vec[ty_param] tps, &span sp, &fn_ident i,
56-
node_id id, @mutable vec[node_id] rs) {
56+
node_id id, @mutable node_id[] rs) {
5757
auto collect_ids = walk::default_visitor();
5858
collect_ids =
5959
rec(visit_expr_pre=bind collect_ids_expr(_, rs),
@@ -63,7 +63,7 @@ fn node_ids_in_fn(&_fn f, &vec[ty_param] tps, &span sp, &fn_ident i,
6363
walk::walk_fn(collect_ids, f, tps, sp, i, id);
6464
}
6565

66-
fn init_vecs(&crate_ctxt ccx, &vec[node_id] node_ids, uint len) {
66+
fn init_vecs(&crate_ctxt ccx, &node_id[] node_ids, uint len) {
6767
for (node_id i in node_ids) {
6868
log int::str(i) + " |-> " + uint::str(len);
6969
add_node(ccx, i, empty_ann(len));
@@ -72,7 +72,7 @@ fn init_vecs(&crate_ctxt ccx, &vec[node_id] node_ids, uint len) {
7272

7373
fn visit_fn(&crate_ctxt ccx, uint num_constraints, &_fn f, &vec[ty_param] tps,
7474
&span sp, &fn_ident i, node_id id) {
75-
let @mutable vec[node_id] node_ids = @mutable [];
75+
let @mutable node_id[] node_ids = @mutable ~[];
7676
node_ids_in_fn(f, tps, sp, i, id, node_ids);
7777
auto node_id_vec = *node_ids;
7878
init_vecs(ccx, node_id_vec, num_constraints);

0 commit comments

Comments
 (0)