@@ -182,22 +182,17 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
182
182
183
183
/// Returns a value and (in case of a ByRef) if we are supposed to use aligned accesses.
184
184
pub ( super ) fn eval_and_read_lvalue ( & mut self , lvalue : & mir:: Lvalue < ' tcx > ) -> EvalResult < ' tcx , Value > {
185
- let ty = self . lvalue_ty ( lvalue) ;
186
185
// Shortcut for things like accessing a fat pointer's field,
187
186
// which would otherwise (in the `eval_lvalue` path) require moving a `ByValPair` to memory
188
187
// and returning an `Lvalue::Ptr` to it
189
188
if let Some ( val) = self . try_read_lvalue ( lvalue) ? {
190
189
return Ok ( val) ;
191
190
}
192
191
let lvalue = self . eval_lvalue ( lvalue) ?;
193
- self . read_lvalue ( lvalue, ty )
192
+ self . read_lvalue ( lvalue)
194
193
}
195
194
196
- pub fn read_lvalue ( & self , lvalue : Lvalue < ' tcx > , ty : Ty < ' tcx > ) -> EvalResult < ' tcx , Value > {
197
- if ty. is_never ( ) {
198
- return Err ( EvalError :: Unreachable ) ;
199
- }
200
-
195
+ pub fn read_lvalue ( & self , lvalue : Lvalue < ' tcx > ) -> EvalResult < ' tcx , Value > {
201
196
match lvalue {
202
197
Lvalue :: Ptr { ptr, extra, aligned } => {
203
198
assert_eq ! ( extra, LvalueExtra :: None ) ;
@@ -382,7 +377,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
382
377
}
383
378
384
379
Deref => {
385
- let val = self . read_lvalue ( base, base_ty ) ?;
380
+ let val = self . read_lvalue ( base) ?;
386
381
387
382
let pointee_type = match base_ty. sty {
388
383
ty:: TyRawPtr ( ref tam) |
0 commit comments