1
1
2
+ import std:: ivec;
2
3
import std:: vec;
3
- import std:: vec:: plus_option;
4
4
import syntax:: ast:: * ;
5
5
import util:: ppaux:: fn_ident_to_string;
6
6
import std:: option:: * ;
@@ -26,22 +26,22 @@ import util::common::new_def_hash;
26
26
import syntax:: codemap:: span;
27
27
import syntax:: ast:: respan;
28
28
29
- type ctxt = rec ( @mutable vec [ aux:: constr ] cs , ty:: ctxt tcx) ;
29
+ type ctxt = rec ( @mutable ( aux:: constr[ ] ) cs , ty:: ctxt tcx) ;
30
30
31
31
fn collect_local ( & @local loc , & ctxt cx, & visit:: vt[ ctxt] v ) {
32
32
log "collect_local: pushing " + loc. node . ident ;
33
- vec :: push ( * cx. cs ,
34
- respan ( loc . span , rec ( id=loc . node . id , c=ninit ( loc. node . ident ) ) ) ) ;
33
+ * cx. cs += ~ [ respan ( loc . span , rec ( id=loc . node . id ,
34
+ c=ninit ( loc. node . ident ) ) ) ] ;
35
35
visit:: visit_local ( loc, cx, v) ;
36
36
}
37
37
38
38
fn collect_pred ( & @expr e , & ctxt cx, & visit:: vt[ ctxt] v ) {
39
39
alt ( e. node ) {
40
40
case ( expr_check ( _, ?ch) ) {
41
- vec :: push ( * cx. cs , expr_to_constr ( cx. tcx , ch) ) ;
41
+ * cx. cs += ~ [ expr_to_constr ( cx. tcx , ch) ] ;
42
42
}
43
43
case ( expr_if_check ( ?ex, _, _) ) {
44
- vec :: push ( * cx. cs , expr_to_constr ( cx. tcx , ex) ) ;
44
+ * cx. cs += ~ [ expr_to_constr ( cx. tcx , ex) ] ;
45
45
}
46
46
// If it's a call, generate appropriate instances of the
47
47
// call's constraints.
@@ -55,7 +55,7 @@ fn collect_pred(&@expr e, &ctxt cx, &visit::vt[ctxt] v) {
55
55
rec ( id=c. node . id . _1 ,
56
56
c=aux:: substitute_constr_args ( cx. tcx ,
57
57
operands_ivec, c) ) ) ;
58
- vec :: push ( * cx. cs , ct ) ;
58
+ * cx. cs += ~ [ ct ] ;
59
59
}
60
60
}
61
61
case ( _) { }
@@ -71,7 +71,7 @@ fn do_nothing(&_fn f, &vec[ty_param] tp, &span sp, &fn_ident i,
71
71
fn find_locals ( & ty:: ctxt tcx, & _fn f, & vec[ ty_param] tps ,
72
72
& span sp, & fn_ident i, node_id id)
73
73
-> ctxt {
74
- let ctxt cx = rec ( cs=@mutable vec :: alloc ( 0 u ) , tcx=tcx) ;
74
+ let ctxt cx = rec ( cs=@mutable ~ [ ] , tcx=tcx) ;
75
75
auto visitor = visit:: default_visitor[ ctxt] ( ) ;
76
76
77
77
visitor =
@@ -140,7 +140,7 @@ fn mk_fn_info(&crate_ctxt ccx, &_fn f, &vec[ty_param] tp,
140
140
let @mutable node_id[ ] v = @mutable ~[ ] ;
141
141
auto rslt =
142
142
rec ( constrs=res_map,
143
- num_constraints=vec :: len ( * cx. cs ) + 1 u,
143
+ num_constraints=ivec :: len ( * cx. cs ) + 1 u,
144
144
cf=f. decl . cf ,
145
145
used_vars=v) ;
146
146
ccx. fm . insert ( id, rslt) ;
0 commit comments