Make MaybeStorageLive drop-aware

This commit is contained in:
Tyler Mandry 2019-05-14 14:08:31 -07:00
parent b789017403
commit dd2eabc49d

View file

@ -43,9 +43,14 @@ impl<'a, 'tcx> BitDenotation<'tcx> for MaybeStorageLive<'a, 'tcx> {
}
fn terminator_effect(&self,
_sets: &mut BlockSets<'_, Local>,
_loc: Location) {
// Terminators have no effect
sets: &mut BlockSets<'_, Local>,
loc: Location) {
match &self.mir[loc.block].terminator().kind {
TerminatorKind::Drop { location, .. } => if let Some(l) = location.local() {
sets.kill(l);
}
_ => (),
}
}
fn propagate_call_return(