]> git.lizzy.rs Git - rust.git/commitdiff
Add `TerminatorKind::DropAndReplace` handling
authorMikhail Modin <mikhailm1@gmail.com>
Thu, 9 Nov 2017 08:55:23 +0000 (11:55 +0300)
committerMikhail Modin <mikhailm1@gmail.com>
Thu, 9 Nov 2017 08:55:23 +0000 (11:55 +0300)
src/librustc_mir/dataflow/impls/mod.rs

index 7022b4dffa04885cdf1fbc2bba0a52ccb1a91604..dad96dc3a6ffeb2c47ae66f8d0d918f49a13cd2e 100644 (file)
@@ -517,6 +517,19 @@ fn terminator_effect(&self,
             assert!(move_index.index() < bits_per_block);
             zero_to_one(sets.gen_set.words_mut(), *move_index);
         }
+        match term.kind {
+            mir::TerminatorKind::DropAndReplace { ref location, .. } => {
+                on_lookup_result_bits(self.tcx,
+                                      mir,
+                                      move_data,
+                                      move_data.rev_lookup.find(location),
+                                      |mpi| for moi in &move_data.path_map[mpi] {
+                                          assert!(moi.index() < bits_per_block);
+                                          sets.kill_set.add(&moi);
+                                      });
+            }
+            _ => {}
+        }
     }
 
     fn propagate_call_return(&self,