@@ -11,8 +11,7 @@ use rustc::ty::{self, query::TyCtxtAt};
1111
1212use super :: {
1313 Allocation , AllocId , InterpResult , Scalar , AllocationExtra ,
14- InterpretCx , PlaceTy , OpTy , ImmTy , MemoryKind , Pointer ,
15- InterpErrorInfo , InterpError
14+ InterpretCx , PlaceTy , OpTy , ImmTy , MemoryKind , Pointer , Memory
1615} ;
1716
1817/// Whether this kind of memory is allowed to leak
@@ -212,19 +211,19 @@ pub trait Machine<'mir, 'tcx>: Sized {
212211
213212 fn int_to_ptr (
214213 int : u64 ,
215- _extra : & Self :: MemoryExtra ,
214+ _mem : & Memory < ' mir , ' tcx , Self > ,
216215 ) -> InterpResult < ' tcx , Pointer < Self :: PointerTag > > {
217216 if int == 0 {
218- Err ( InterpErrorInfo :: from ( InterpError :: InvalidNullPointerUsage ) )
217+ err ! ( InvalidNullPointerUsage )
219218 } else {
220- Err ( InterpErrorInfo :: from ( InterpError :: ReadBytesAsPointer ) )
219+ err ! ( ReadBytesAsPointer )
221220 }
222221 }
223222
224223 fn ptr_to_int (
225224 _ptr : Pointer < Self :: PointerTag > ,
226- _extra : & Self :: MemoryExtra ,
225+ _mem : & Memory < ' mir , ' tcx , Self > ,
227226 ) -> InterpResult < ' tcx , u64 > {
228- Err ( InterpErrorInfo :: from ( InterpError :: ReadPointerAsBytes ) )
227+ err ! ( ReadPointerAsBytes )
229228 }
230229}
0 commit comments