]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/mir/interpret/pointer.rs
rename EvalResult -> InterpResult and EvalError -> InterpErrorInfo
[rust.git] / src / librustc / mir / interpret / pointer.rs
index 4aa83a79d52b8bef5a187e14679eefde153417a2..a6c47ff5ca0f77128b14f87c7cf2c2125c7b3c49 100644 (file)
@@ -5,7 +5,7 @@
 use rustc_macros::HashStable;
 
 use super::{
-    AllocId, EvalResult, CheckInAllocMsg
+    AllocId, InterpResult, CheckInAllocMsg
 };
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -52,13 +52,13 @@ fn overflowing_signed_offset(&self, val: u64, i: i128) -> (u64, bool) {
     }
 
     #[inline]
-    fn offset<'tcx>(&self, val: u64, i: u64) -> EvalResult<'tcx, u64> {
+    fn offset<'tcx>(&self, val: u64, i: u64) -> InterpResult<'tcx, u64> {
         let (res, over) = self.overflowing_offset(val, i);
         if over { err!(Overflow(mir::BinOp::Add)) } else { Ok(res) }
     }
 
     #[inline]
-    fn signed_offset<'tcx>(&self, val: u64, i: i64) -> EvalResult<'tcx, u64> {
+    fn signed_offset<'tcx>(&self, val: u64, i: i64) -> InterpResult<'tcx, u64> {
         let (res, over) = self.overflowing_signed_offset(val, i128::from(i));
         if over { err!(Overflow(mir::BinOp::Add)) } else { Ok(res) }
     }
@@ -125,7 +125,7 @@ pub fn new_with_tag(alloc_id: AllocId, offset: Size, tag: Tag) -> Self {
     }
 
     #[inline]
-    pub fn offset(self, i: Size, cx: &impl HasDataLayout) -> EvalResult<'tcx, Self> {
+    pub fn offset(self, i: Size, cx: &impl HasDataLayout) -> InterpResult<'tcx, Self> {
         Ok(Pointer::new_with_tag(
             self.alloc_id,
             Size::from_bytes(cx.data_layout().offset(self.offset.bytes(), i.bytes())?),
@@ -145,7 +145,7 @@ pub fn wrapping_offset(self, i: Size, cx: &impl HasDataLayout) -> Self {
     }
 
     #[inline]
-    pub fn signed_offset(self, i: i64, cx: &impl HasDataLayout) -> EvalResult<'tcx, Self> {
+    pub fn signed_offset(self, i: i64, cx: &impl HasDataLayout) -> InterpResult<'tcx, Self> {
         Ok(Pointer::new_with_tag(
             self.alloc_id,
             Size::from_bytes(cx.data_layout().signed_offset(self.offset.bytes(), i)?),
@@ -174,7 +174,7 @@ pub fn check_in_alloc(
         self,
         allocation_size: Size,
         msg: CheckInAllocMsg,
-    ) -> EvalResult<'tcx, ()> {
+    ) -> InterpResult<'tcx, ()> {
         if self.offset > allocation_size {
             err!(PointerOutOfBounds {
                 ptr: self.erase_tag(),