about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2019-05-24 20:37:57 +0200
committerSantiago Pastorino <spastorino@gmail.com>2019-05-24 21:13:19 +0200
commit8173febf930121e954a4be09043482ee771c0794 (patch)
tree4179c88bfaef10a13a3b1f9ba779749b1b56ff6e
parentfc45382c125d940822368e866588568d78551946 (diff)
downloadrust-8173febf930121e954a4be09043482ee771c0794.tar.gz
rust-8173febf930121e954a4be09043482ee771c0794.zip
Avoid catch-all arm, use Base(PlaceBase::Static(_))
-rw-r--r--src/librustc_mir/interpret/operand.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/librustc_mir/interpret/operand.rs b/src/librustc_mir/interpret/operand.rs
index 9c2b491925f..11bf750e8c7 100644
--- a/src/librustc_mir/interpret/operand.rs
+++ b/src/librustc_mir/interpret/operand.rs
@@ -472,13 +472,12 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> InterpretCx<'a, 'mir, 'tcx, M>
         let op = match *mir_place {
             Base(PlaceBase::Local(mir::RETURN_PLACE)) => return err!(ReadFromReturnPointer),
             Base(PlaceBase::Local(local)) => self.access_local(self.frame(), local, layout)?,
+            Base(PlaceBase::Static(_)) => self.eval_place_to_mplace(mir_place)?.into(),
 
             Projection(ref proj) => {
                 let op = self.eval_place_to_op(&proj.base, None)?;
                 self.operand_projection(op, &proj.elem)?
             }
-
-            _ => self.eval_place_to_mplace(mir_place)?.into(),
         };
 
         trace!("eval_place_to_op: got {:?}", *op);