@@ -11,8 +11,7 @@ use rustc::ty::{self, query::TyCtxtAt};
11
11
12
12
use super :: {
13
13
Allocation , AllocId , InterpResult , Scalar , AllocationExtra ,
14
- InterpretCx , PlaceTy , OpTy , ImmTy , MemoryKind , Pointer ,
15
- InterpErrorInfo , InterpError
14
+ InterpretCx , PlaceTy , OpTy , ImmTy , MemoryKind , Pointer , Memory
16
15
} ;
17
16
18
17
/// Whether this kind of memory is allowed to leak
@@ -212,19 +211,19 @@ pub trait Machine<'mir, 'tcx>: Sized {
212
211
213
212
fn int_to_ptr (
214
213
int : u64 ,
215
- _extra : & Self :: MemoryExtra ,
214
+ _mem : & Memory < ' mir , ' tcx , Self > ,
216
215
) -> InterpResult < ' tcx , Pointer < Self :: PointerTag > > {
217
216
if int == 0 {
218
- Err ( InterpErrorInfo :: from ( InterpError :: InvalidNullPointerUsage ) )
217
+ err ! ( InvalidNullPointerUsage )
219
218
} else {
220
- Err ( InterpErrorInfo :: from ( InterpError :: ReadBytesAsPointer ) )
219
+ err ! ( ReadBytesAsPointer )
221
220
}
222
221
}
223
222
224
223
fn ptr_to_int (
225
224
_ptr : Pointer < Self :: PointerTag > ,
226
- _extra : & Self :: MemoryExtra ,
225
+ _mem : & Memory < ' mir , ' tcx , Self > ,
227
226
) -> InterpResult < ' tcx , u64 > {
228
- Err ( InterpErrorInfo :: from ( InterpError :: ReadPointerAsBytes ) )
227
+ err ! ( ReadPointerAsBytes )
229
228
}
230
229
}
0 commit comments