use rustc::ty::{Ty, TypeFoldable};
use rustc_data_structures::fx::FxHashMap;
use std::rc::Rc;
-use util::liveness::LivenessResults;
+use util::liveness::{IdentityMap, LivenessResults};
use super::TypeChecker;
pub(super) fn generate<'gcx, 'tcx>(
cx: &mut TypeChecker<'_, 'gcx, 'tcx>,
mir: &Mir<'tcx>,
- liveness: &LivenessResults,
+ liveness: &LivenessResults<Local>,
flow_inits: &mut FlowAtLocation<MaybeInitializedPlaces<'_, 'gcx, 'tcx>>,
move_data: &MoveData<'tcx>,
) {
flow_inits,
move_data,
drop_data: FxHashMap(),
+ map: &IdentityMap::new(mir),
};
for bb in mir.basic_blocks().indices() {
{
cx: &'gen mut TypeChecker<'typeck, 'gcx, 'tcx>,
mir: &'gen Mir<'tcx>,
- liveness: &'gen LivenessResults,
+ liveness: &'gen LivenessResults<Local>,
flow_inits: &'gen mut FlowAtLocation<MaybeInitializedPlaces<'flow, 'gcx, 'tcx>>,
move_data: &'gen MoveData<'tcx>,
drop_data: FxHashMap<Ty<'tcx>, DropData<'tcx>>,
+ map: &'gen IdentityMap<'gen, 'tcx>,
}
struct DropData<'tcx> {
self.liveness
.regular
- .simulate_block(self.mir, bb, |location, live_locals| {
+ .simulate_block(self.mir, bb, self.map, |location, live_locals| {
for live_local in live_locals.iter() {
let live_local_ty = self.mir.local_decls[live_local].ty;
Self::push_type_live_constraint(&mut self.cx, live_local_ty, location);
let mut all_live_locals: Vec<(Location, Vec<Local>)> = vec![];
self.liveness
.drop
- .simulate_block(self.mir, bb, |location, live_locals| {
+ .simulate_block(self.mir, bb, self.map, |location, live_locals| {
all_live_locals.push((location, live_locals.iter().collect()));
});
debug!(