rustc: Remove a few scattered uses of exterior vectors from typestate
This commit is contained in:
parent
0ffe8c81c3
commit
f7ba28573f
3 changed files with 6 additions and 18 deletions
|
@ -63,13 +63,8 @@ fn bit_num(&fn_ctxt fcx, &constr_ c) -> uint {
|
|||
case (npred(_, ?args)) {
|
||||
alt (rslt) {
|
||||
case (cpred(_, ?descs)) {
|
||||
// FIXME: Remove this vec->ivec conversion.
|
||||
let (@constr_arg_use)[] cau_ivec = ~[];
|
||||
for (@constr_arg_use cau in args) {
|
||||
cau_ivec += ~[cau];
|
||||
}
|
||||
auto d = *descs;
|
||||
ret match_args(fcx, d, cau_ivec);
|
||||
ret match_args(fcx, d, args);
|
||||
}
|
||||
case (_) {
|
||||
fcx.ccx.tcx.sess.bug("bit_num: asked for pred constraint,"
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
|
||||
import std::ivec;
|
||||
import std::vec;
|
||||
import syntax::ast::*;
|
||||
import util::ppaux::fn_ident_to_string;
|
||||
import std::option::*;
|
||||
|
@ -35,15 +34,11 @@ fn collect_pred(&@expr e, &ctxt cx, &visit::vt[ctxt] v) {
|
|||
// If it's a call, generate appropriate instances of the
|
||||
// call's constraints.
|
||||
case (expr_call(?operator, ?operands)) {
|
||||
// FIXME: Remove this vec->ivec conversion.
|
||||
auto operands_ivec = ~[];
|
||||
for (@expr opd in operands) { operands_ivec += ~[opd]; }
|
||||
|
||||
for (@ty::constr_def c in constraints_expr(cx.tcx, operator)) {
|
||||
let aux::constr ct = respan(c.span,
|
||||
rec(id=c.node.id._1,
|
||||
c=aux::substitute_constr_args(cx.tcx,
|
||||
operands_ivec, c)));
|
||||
c=aux::substitute_constr_args(cx.tcx, operands,
|
||||
c)));
|
||||
*cx.cs += ~[ct];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
import std::ivec;
|
||||
import std::vec;
|
||||
import std::vec::plus_option;
|
||||
import std::option;
|
||||
import std::option::none;
|
||||
import std::option::some;
|
||||
|
@ -503,8 +501,8 @@ fn find_pre_post_expr(&fn_ctxt fcx, @expr e) {
|
|||
find_pre_post_block(fcx, an_alt.block);
|
||||
ret block_pp(fcx.ccx, an_alt.block);
|
||||
}
|
||||
auto alt_pps = [];
|
||||
for (arm a in alts) { alt_pps += [do_an_alt(fcx, a)]; }
|
||||
auto alt_pps = ~[];
|
||||
for (arm a in alts) { alt_pps += ~[do_an_alt(fcx, a)]; }
|
||||
fn combine_pp(pre_and_post antec, fn_ctxt fcx, &pre_and_post pp,
|
||||
&pre_and_post next) -> pre_and_post {
|
||||
union(pp.precondition, seq_preconds(fcx, ~[antec, next]));
|
||||
|
@ -517,7 +515,7 @@ fn find_pre_post_expr(&fn_ctxt fcx, @expr e) {
|
|||
postcondition=false_postcond(num_local_vars));
|
||||
auto g = bind combine_pp(antec_pp, fcx, _, _);
|
||||
auto alts_overall_pp =
|
||||
vec::foldl[pre_and_post, pre_and_post](g, e_pp, alt_pps);
|
||||
ivec::foldl[pre_and_post, pre_and_post](g, e_pp, alt_pps);
|
||||
set_pre_and_post(fcx.ccx, e.id, alts_overall_pp.precondition,
|
||||
alts_overall_pp.postcondition);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue