Skip to content

Commit

Permalink
Make MaybeStorageLive drop-aware
Browse files Browse the repository at this point in the history
  • Loading branch information
tmandry committed May 15, 2019
1 parent b789017 commit dd2eabc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/librustc_mir/dataflow/impls/storage_liveness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit dd2eabc

Please sign in to comment.