mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-22 04:27:33 +00:00
Make more MIR match statements exhaustive.
This commit is contained in:
parent
69f41facb9
commit
3fc9b7dd2c
@ -655,7 +655,7 @@ impl<'a, 'tcx: 'a, 'arena> Interpreter<'a, 'tcx, 'arena> {
|
|||||||
try!(self.const_to_ptr(value)),
|
try!(self.const_to_ptr(value)),
|
||||||
self.ty_to_repr(ty),
|
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],
|
Var(i) => self.frame().locals[self.frame().var_offset + i as usize],
|
||||||
Temp(i) => self.frame().locals[self.frame().temp_offset + i as usize],
|
Temp(i) => self.frame().locals[self.frame().temp_offset + i as usize],
|
||||||
|
|
||||||
|
Static(_def_id) => unimplemented!(),
|
||||||
|
|
||||||
Projection(ref proj) => {
|
Projection(ref proj) => {
|
||||||
let base_ptr = try!(self.eval_lvalue(&proj.base)).ptr;
|
let base_ptr = try!(self.eval_lvalue(&proj.base)).ptr;
|
||||||
let base_repr = self.lvalue_repr(&proj.base);
|
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)
|
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 })
|
Ok(Lvalue { ptr: ptr, extra: LvalueExtra::None })
|
||||||
|
Loading…
Reference in New Issue
Block a user