use rustc::mir::{self, BasicBlock, BasicBlockData, Mir, Statement, Terminator, Location};
use rustc::session::Session;
use rustc::ty::{self, TyCtxt};
+use rustc_mir::util::elaborate_drops::DropFlagState;
mod abs_domain;
pub mod elaborate_drops;
mod dataflow;
mod gather_moves;
-mod patch;
// mod graphviz;
use self::dataflow::{BitDenotation};
}
}
-#[derive(Debug, PartialEq, Eq, Copy, Clone)]
-enum DropFlagState {
- Present, // i.e. initialized
- Absent, // i.e. deinitialized or "moved"
-}
-
-impl DropFlagState {
- fn value(self) -> bool {
- match self {
- DropFlagState::Present => true,
- DropFlagState::Absent => false
- }
- }
-}
-
fn move_path_children_matching<'tcx, F>(move_data: &MoveData<'tcx>,
path: MovePathIndex,
mut cond: F)
lv, ty);
true
}
- ty::TyAdt(def, _) if (def.has_dtor() && !def.is_box()) || def.is_union() => {
+ ty::TyAdt(def, _) if (def.has_dtor(tcx) && !def.is_box()) || def.is_union() => {
debug!("lvalue_contents_drop_state_cannot_differ lv: {:?} ty: {:?} Drop => true",
lv, ty);
true
}
mir::StatementKind::StorageLive(_) |
mir::StatementKind::StorageDead(_) |
+ mir::StatementKind::InlineAsm { .. } |
mir::StatementKind::Nop => {}
},
None => {