Make MaybeStorageLive drop-aware
This commit is contained in:
parent
b789017403
commit
dd2eabc49d
1 changed files with 8 additions and 3 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue