]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/dataflow/impls/storage_liveness.rs
Remove PlaceBase enum and make Place base field be local: Local
[rust.git] / src / librustc_mir / dataflow / impls / storage_liveness.rs
index 17f71e83cfd21c8d3f917b288cee817795c21d3f..6a48d1e98032c0d92426e1b7ae2d8e9b3e2c9144 100644 (file)
@@ -116,15 +116,11 @@ fn before_statement_effect(&self, sets: &mut GenKillSet<Self::Idx>, loc: Locatio
             StatementKind::StorageDead(l) => sets.kill(l),
             StatementKind::Assign(box (ref place, _))
             | StatementKind::SetDiscriminant { box ref place, .. } => {
-                if let PlaceBase::Local(local) = place.base {
-                    sets.gen(local);
-                }
+                sets.gen(place.local);
             }
             StatementKind::InlineAsm(box InlineAsm { ref outputs, .. }) => {
-                for p in &**outputs {
-                    if let PlaceBase::Local(local) = p.base {
-                        sets.gen(local);
-                    }
+                for place in &**outputs {
+                    sets.gen(place.local);
                 }
             }
             _ => (),
@@ -140,10 +136,8 @@ fn statement_effect(&self, sets: &mut GenKillSet<Local>, loc: Location) {
     fn before_terminator_effect(&self, sets: &mut GenKillSet<Local>, loc: Location) {
         self.check_for_borrow(sets, loc);
 
-        if let TerminatorKind::Call {
-            destination: Some((Place { base: PlaceBase::Local(local), .. }, _)),
-            ..
-        } = self.body[loc.block].terminator().kind
+        if let TerminatorKind::Call { destination: Some((Place { local, .. }, _)), .. } =
+            self.body[loc.block].terminator().kind
         {
             sets.gen(local);
         }
@@ -171,9 +165,7 @@ fn propagate_call_return(
         _dest_bb: mir::BasicBlock,
         dest_place: &mir::Place<'tcx>,
     ) {
-        if let PlaceBase::Local(local) = dest_place.base {
-            in_out.insert(local);
-        }
+        in_out.insert(dest_place.local);
     }
 }