From 3fc9b7dd2c94968faedca8efbf3f313d38da68b2 Mon Sep 17 00:00:00 2001 From: Scott Olson Date: Mon, 21 Mar 2016 04:01:52 -0600 Subject: [PATCH] Make more MIR match statements exhaustive. --- src/interpreter.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/interpreter.rs b/src/interpreter.rs index affd83bb077..e5c45d99961 100644 --- a/src/interpreter.rs +++ b/src/interpreter.rs @@ -655,7 +655,7 @@ impl<'a, 'tcx: 'a, 'arena> Interpreter<'a, 'tcx, 'arena> { try!(self.const_to_ptr(value)), self.ty_to_repr(ty), )), - ref l => panic!("can't handle item literal: {:?}", l), + Item { .. } => unimplemented!(), } } } @@ -683,6 +683,8 @@ impl<'a, 'tcx: 'a, 'arena> Interpreter<'a, 'tcx, 'arena> { Var(i) => self.frame().locals[self.frame().var_offset + i as usize], Temp(i) => self.frame().locals[self.frame().temp_offset + i as usize], + Static(_def_id) => unimplemented!(), + Projection(ref proj) => { let base_ptr = try!(self.eval_lvalue(&proj.base)).ptr; let base_repr = self.lvalue_repr(&proj.base); @@ -728,11 +730,9 @@ impl<'a, 'tcx: 'a, 'arena> Interpreter<'a, 'tcx, 'arena> { base_ptr.offset(n as isize * elem_size as isize) } - ref p => panic!("can't handle lvalue projection: {:?}", p), + ConstantIndex { .. } => unimplemented!(), } } - - ref l => panic!("can't handle lvalue: {:?}", l), }; Ok(Lvalue { ptr: ptr, extra: LvalueExtra::None })