use self::LiveNodeKind::*;
use self::VarKind::*;
-use dep_graph::DepNode;
use hir::def::*;
use ty::{self, TyCtxt, ParameterEnvironment};
use traits::{self, Reveal};
}
pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
- let _task = tcx.dep_graph.in_task(DepNode::Liveness);
tcx.hir.krate().visit_all_item_likes(&mut IrMaps::new(tcx).as_deep_visitor());
tcx.sess.abort_if_errors();
}
fn propagate_through_block(&mut self, blk: &hir::Block, succ: LiveNode)
-> LiveNode {
- if let Some(break_to_expr_id) = blk.break_to_expr_id {
- self.breakable_block_ln.insert(break_to_expr_id, succ);
+ if blk.targeted_by_break {
+ self.breakable_block_ln.insert(blk.id, succ);
}
let succ = self.propagate_through_opt_expr(blk.expr.as_ref().map(|e| &**e), succ);
blk.stmts.iter().rev().fold(succ, |succ, stmt| {
// ( succ )
//
let else_ln = self.propagate_through_opt_expr(els.as_ref().map(|e| &**e), succ);
- let then_ln = self.propagate_through_block(&then, succ);
+ let then_ln = self.propagate_through_expr(&then, succ);
let ln = self.live_node(expr.id, expr.span);
self.init_from_succ(ln, else_ln);
self.merge_from_succ(ln, then_ln, false);