@@ -10,8 +10,8 @@ use rustc::mir;
1010use rustc:: ty:: { self , TyCtxt } ;
1111
1212use super :: {
13- Allocation , AllocId , InterpResult , Scalar , AllocationExtra ,
14- InterpCx , PlaceTy , OpTy , ImmTy , MemoryKind , Pointer , Memory
13+ Allocation , AllocId , InterpResult , InterpError , Scalar , AllocationExtra ,
14+ InterpCx , PlaceTy , OpTy , ImmTy , MemoryKind , Pointer , Memory ,
1515} ;
1616
1717/// Whether this kind of memory is allowed to leak
@@ -209,17 +209,19 @@ pub trait Machine<'mir, 'tcx>: Sized {
209209 extra : Self :: FrameExtra ,
210210 ) -> InterpResult < ' tcx > ;
211211
212+ #[ inline( always) ]
212213 fn int_to_ptr (
213214 _mem : & Memory < ' mir , ' tcx , Self > ,
214215 int : u64 ,
215216 ) -> InterpResult < ' tcx , Pointer < Self :: PointerTag > > {
216- if int == 0 {
217- err ! ( InvalidNullPointerUsage )
217+ Err ( ( if int == 0 {
218+ InterpError :: InvalidNullPointerUsage
218219 } else {
219- err ! ( ReadBytesAsPointer )
220- }
220+ InterpError :: ReadBytesAsPointer
221+ } ) . into ( ) )
221222 }
222223
224+ #[ inline( always) ]
223225 fn ptr_to_int (
224226 _mem : & Memory < ' mir , ' tcx , Self > ,
225227 _ptr : Pointer < Self :: PointerTag > ,
0 commit comments