Skip to content

Commit dd2eabc

Browse files
committedMay 15, 2019
Make MaybeStorageLive drop-aware
1 parent b789017 commit dd2eabc

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed
 

‎src/librustc_mir/dataflow/impls/storage_liveness.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,14 @@ impl<'a, 'tcx> BitDenotation<'tcx> for MaybeStorageLive<'a, 'tcx> {
4343
}
4444

4545
fn terminator_effect(&self,
46-
_sets: &mut BlockSets<'_, Local>,
47-
_loc: Location) {
48-
// Terminators have no effect
46+
sets: &mut BlockSets<'_, Local>,
47+
loc: Location) {
48+
match &self.mir[loc.block].terminator().kind {
49+
TerminatorKind::Drop { location, .. } => if let Some(l) = location.local() {
50+
sets.kill(l);
51+
}
52+
_ => (),
53+
}
4954
}
5055

5156
fn propagate_call_return(

0 commit comments

Comments
 (0)
Please sign in to comment.