remove dead assignments
This commit is contained in:
parent
f5c51b0a9c
commit
ccd8d5573e
16 changed files with 24 additions and 51 deletions
|
|
@ -3855,7 +3855,7 @@ fn trans_break_cont(bcx: block, to_end: bool)
|
|||
let _icx = bcx.insn_ctxt("trans_break_cont");
|
||||
// Locate closest loop block, outputting cleanup as we go.
|
||||
let mut unwind = bcx;
|
||||
let mut target = bcx;
|
||||
let mut target = bcx; // FIXME---not necc. but tstate thinks it is
|
||||
loop {
|
||||
alt unwind.kind {
|
||||
block_scope({loop_break: some(brk), _}) {
|
||||
|
|
|
|||
|
|
@ -472,7 +472,8 @@ fn node_id_to_def(ccx: crate_ctxt, id: node_id) -> option<def> {
|
|||
|
||||
fn norm_a_constraint(id: def_id, c: constraint) -> [norm_constraint] {
|
||||
let mut rslt: [norm_constraint] = [];
|
||||
for vec::each(*c.descs) {|pd|
|
||||
let descs = *c.descs;
|
||||
for vec::each(descs) {|pd|
|
||||
rslt +=
|
||||
[{bit_num: pd.node.bit_num,
|
||||
c: respan(pd.span, {path: c.path,
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ fn join_then_else(fcx: fn_ctxt, antec: @expr, conseq: blk,
|
|||
}
|
||||
|
||||
fn gen_if_local(fcx: fn_ctxt, lhs: @expr, rhs: @expr, larger_id: node_id,
|
||||
new_var: node_id, pth: @path) {
|
||||
new_var: node_id) {
|
||||
alt node_id_to_def(fcx.ccx, new_var) {
|
||||
some(d) {
|
||||
alt d {
|
||||
|
|
@ -206,7 +206,7 @@ fn handle_update(fcx: fn_ctxt, parent: @expr, lhs: @expr, rhs: @expr,
|
|||
_ { }
|
||||
}
|
||||
|
||||
gen_if_local(fcx, lhs, rhs, parent.id, lhs.id, p);
|
||||
gen_if_local(fcx, lhs, rhs, parent.id, lhs.id);
|
||||
alt rhs.node {
|
||||
expr_path(p1) {
|
||||
let d = local_node_id_to_local_def_id(fcx, lhs.id);
|
||||
|
|
|
|||
|
|
@ -197,30 +197,6 @@ fn find_pre_post_state_exprs(fcx: fn_ctxt, pres: prestate, id: node_id,
|
|||
ret changed;
|
||||
}
|
||||
|
||||
fn find_pre_post_state_loop(fcx: fn_ctxt, pres: prestate, l: @local,
|
||||
index: @expr, body: blk, id: node_id) -> bool {
|
||||
// I'm confused about this -- how does the poststate for the body
|
||||
// ever grow larger? It seems like it can't?
|
||||
let loop_pres = intersect_states(pres, block_poststate(fcx.ccx, body));
|
||||
|
||||
let mut changed =
|
||||
set_prestate_ann(fcx.ccx, id, loop_pres) |
|
||||
find_pre_post_state_expr(fcx, pres, index);
|
||||
|
||||
let index_post = tritv_clone(expr_poststate(fcx.ccx, index));
|
||||
changed |= find_pre_post_state_block(fcx, index_post, body);
|
||||
|
||||
if has_nonlocal_exits(body) {
|
||||
// See [Break-unsound]
|
||||
ret changed | set_poststate_ann(fcx.ccx, id, pres);
|
||||
} else {
|
||||
let res_p =
|
||||
intersect_states(expr_poststate(fcx.ccx, index),
|
||||
block_poststate(fcx.ccx, body));
|
||||
ret changed | set_poststate_ann(fcx.ccx, id, res_p);
|
||||
}
|
||||
}
|
||||
|
||||
fn join_then_else(fcx: fn_ctxt, antec: @expr, conseq: blk,
|
||||
maybe_alt: option<@expr>, id: node_id, chk: if_ty,
|
||||
pres: prestate) -> bool {
|
||||
|
|
@ -664,7 +640,6 @@ fn find_pre_post_state_block(fcx: fn_ctxt, pres0: prestate, b: blk) -> bool {
|
|||
fn find_pre_post_state_fn(fcx: fn_ctxt,
|
||||
f_decl: fn_decl,
|
||||
f_body: blk) -> bool {
|
||||
let num_constrs = num_constraints(fcx.enclosing);
|
||||
// All constraints are considered false until proven otherwise.
|
||||
// This ensures that intersect works correctly.
|
||||
kill_all_prestate(fcx, f_body.node.id);
|
||||
|
|
|
|||
|
|
@ -1481,7 +1481,7 @@ fn check_expr_with_unifier(fcx: @fn_ctxt,
|
|||
}
|
||||
some(bexpr) {
|
||||
let bexpr_t = fcx.expr_ty(bexpr);
|
||||
let mut base_fields: [field] = [];
|
||||
let mut base_fields; // FIXME remove mut after snapshot
|
||||
alt structure_of(fcx, expr.span, bexpr_t) {
|
||||
ty::ty_rec(flds) { base_fields = flds; }
|
||||
_ {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ fn check_alt(fcx: @fn_ctxt,
|
|||
discrim: @ast::expr,
|
||||
arms: [ast::arm]) -> bool {
|
||||
let tcx = fcx.ccx.tcx;
|
||||
let mut bot = false;
|
||||
let mut bot;
|
||||
|
||||
let pattern_ty = fcx.infcx.next_ty_var();
|
||||
bot = check_expr_with(fcx, discrim, pattern_ty);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue