about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorTyler Mandry <tmandry@gmail.com>2019-05-14 14:08:31 -0700
committerTyler Mandry <tmandry@gmail.com>2019-05-14 18:33:13 -0700
commitdd2eabc49d415dd30cea0953df5d7659d4d9440f (patch)
treea5499d4d78215450575b2843b84186514adcb516 /src
parentb789017403beb28c7f73cdd994e7fbd982a311f0 (diff)
downloadrust-dd2eabc49d415dd30cea0953df5d7659d4d9440f.tar.gz
rust-dd2eabc49d415dd30cea0953df5d7659d4d9440f.zip
Make MaybeStorageLive drop-aware
Diffstat (limited to 'src')
-rw-r--r--src/librustc_mir/dataflow/impls/storage_liveness.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/librustc_mir/dataflow/impls/storage_liveness.rs b/src/librustc_mir/dataflow/impls/storage_liveness.rs
index 6b8eb6f17f6..3bf11c57379 100644
--- a/src/librustc_mir/dataflow/impls/storage_liveness.rs
+++ b/src/librustc_mir/dataflow/impls/storage_liveness.rs
@@ -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(