mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-02 06:28:20 +03:00
Make more MIR match statements exhaustive.
This commit is contained in:
+4
-4
@@ -655,7 +655,7 @@ fn eval_operand_and_repr(&mut self, op: &mir::Operand<'tcx>)
|
||||
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 @@ fn eval_lvalue(&mut self, lvalue: &mir::Lvalue<'tcx>) -> EvalResult<Lvalue> {
|
||||
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 @@ fn eval_lvalue(&mut self, lvalue: &mir::Lvalue<'tcx>) -> EvalResult<Lvalue> {
|
||||
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 })
|
||||
|
||||
Reference in New Issue
Block a user