about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2017-07-13 04:40:57 +0200
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2017-07-28 15:46:24 +0200
commit21f2d259e0fc563edf8d9b076f156c8c2fcb886f (patch)
treeaabb9c44570667e4ac16605c82269a91f4fdf064
parent75eb59895f0de231fd8fe66fd78518387c99b9fc (diff)
Consider StorageDead and StorageLive as gens for liveness analysis
-rw-r--r--src/librustc_mir/util/liveness.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/librustc_mir/util/liveness.rs b/src/librustc_mir/util/liveness.rs
index 79293cfde25..c96e3ec057b 100644
--- a/src/librustc_mir/util/liveness.rs
+++ b/src/librustc_mir/util/liveness.rs
@@ -46,7 +46,10 @@ impl<'tcx> Visitor<'tcx> for BlockInfoVisitor {
                     location: Location) {
         if let Lvalue::Local(local) = *lvalue {
             match context {
-                LvalueContext::Store | LvalueContext::Call => {
+                LvalueContext::Store |
+                LvalueContext::Call |
+                LvalueContext::StorageLive |
+                LvalueContext::StorageDead => {
                     self.defs.add(&local);
                 }
                 LvalueContext::Projection(..) |
@@ -59,7 +62,6 @@ impl<'tcx> Visitor<'tcx> for BlockInfoVisitor {
                         self.uses.add(&local);
                     }
                 }
-                LvalueContext::StorageLive | LvalueContext::StorageDead => (),
             }
         }