about summary refs log tree commit diff
path: root/src/librustc
diff options
context:
space:
mode:
authorSaleem Jaffer <ssaleem1992@gmail.com>2019-07-30 16:08:32 +0530
committerSaleem Jaffer <ssaleem1992@gmail.com>2019-07-30 16:08:32 +0530
commitfc5df1dfbfdd9af311e04b4841f209b0fc9aaafb (patch)
treebe054b5ff9f3d53a71f829cd1f8e958bd8eeec88 /src/librustc
parentb60a336e86dece15a277139ba76117ed4f17eb3c (diff)
downloadrust-fc5df1dfbfdd9af311e04b4841f209b0fc9aaafb.tar.gz
rust-fc5df1dfbfdd9af311e04b4841f209b0fc9aaafb.zip
renaming err to err_unsup
Diffstat (limited to 'src/librustc')
-rw-r--r--src/librustc/mir/interpret/allocation.rs6
-rw-r--r--src/librustc/mir/interpret/error.rs4
-rw-r--r--src/librustc/mir/interpret/mod.rs4
-rw-r--r--src/librustc/mir/interpret/pointer.rs2
-rw-r--r--src/librustc/mir/interpret/value.rs12
5 files changed, 14 insertions, 14 deletions
diff --git a/src/librustc/mir/interpret/allocation.rs b/src/librustc/mir/interpret/allocation.rs
index 00f90800794..b8686754fa7 100644
--- a/src/librustc/mir/interpret/allocation.rs
+++ b/src/librustc/mir/interpret/allocation.rs
@@ -244,7 +244,7 @@ impl<'tcx, Tag: Copy, Extra: AllocationExtra<Tag>> Allocation<Tag, Extra> {
                 Ok(&self.get_bytes(cx, ptr, size_with_null)?[..size])
             }
             // This includes the case where `offset` is out-of-bounds to begin with.
-            None => throw_err!(UnterminatedCString(ptr.erase_tag())),
+            None => throw_err_unsup!(UnterminatedCString(ptr.erase_tag())),
         }
     }
 
@@ -446,7 +446,7 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
         if self.relocations(cx, ptr, size).is_empty() {
             Ok(())
         } else {
-            throw_err!(ReadPointerAsBytes)
+            throw_err_unsup!(ReadPointerAsBytes)
         }
     }
 
@@ -516,7 +516,7 @@ impl<'tcx, Tag, Extra> Allocation<Tag, Extra> {
         self.undef_mask.is_range_defined(
             ptr.offset,
             ptr.offset + size,
-        ).or_else(|idx| throw_err!(ReadUndefBytes(idx)))
+        ).or_else(|idx| throw_err_unsup!(ReadUndefBytes(idx)))
     }
 
     pub fn mark_definedness(
diff --git a/src/librustc/mir/interpret/error.rs b/src/librustc/mir/interpret/error.rs
index 183298ee3f1..7108f69d39e 100644
--- a/src/librustc/mir/interpret/error.rs
+++ b/src/librustc/mir/interpret/error.rs
@@ -184,8 +184,8 @@ pub fn struct_error<'tcx>(tcx: TyCtxtAt<'tcx>, msg: &str) -> DiagnosticBuilder<'
 /// Packages the kind of error we got from the const code interpreter
 /// up with a Rust-level backtrace of where the error occured.
 /// Thsese should always be constructed by calling `.into()` on
-/// a `InterpError`. In `librustc_mir::interpret`, we have the `throw_err!`
-/// macro for this.
+/// a `InterpError`. In `librustc_mir::interpret`, we have `throw_err_*`
+/// macros for this.
 #[derive(Debug, Clone)]
 pub struct InterpErrorInfo<'tcx> {
     pub kind: InterpError<'tcx>,
diff --git a/src/librustc/mir/interpret/mod.rs b/src/librustc/mir/interpret/mod.rs
index 6e8e56a1b11..bc72050de18 100644
--- a/src/librustc/mir/interpret/mod.rs
+++ b/src/librustc/mir/interpret/mod.rs
@@ -1,7 +1,7 @@
 //! An interpreter for MIR used in CTFE and by miri
 
 #[macro_export]
-macro_rules! throw_err {
+macro_rules! throw_err_unsup {
     ($($tt:tt)*) => {
         Err($crate::mir::interpret::InterpError::Unsupported(
             $crate::mir::interpret::UnsupportedOpInfo::$($tt)*
@@ -55,7 +55,7 @@ macro_rules! err_inval {
 }
 
 #[macro_export]
-macro_rules! err {
+macro_rules! err_unsup {
     ($($tt:tt)*) => {
         $crate::mir::interpret::InterpError::Unsupported(
             $crate::mir::interpret::UnsupportedOpInfo::$($tt)*
diff --git a/src/librustc/mir/interpret/pointer.rs b/src/librustc/mir/interpret/pointer.rs
index 27a41bba4c1..17f963609f6 100644
--- a/src/librustc/mir/interpret/pointer.rs
+++ b/src/librustc/mir/interpret/pointer.rs
@@ -196,7 +196,7 @@ impl<'tcx, Tag> Pointer<Tag> {
         msg: CheckInAllocMsg,
     ) -> InterpResult<'tcx, ()> {
         if self.offset > allocation_size {
-            throw_err!(PointerOutOfBounds { ptr: self.erase_tag(), msg, allocation_size })
+            throw_err_unsup!(PointerOutOfBounds { ptr: self.erase_tag(), msg, allocation_size })
         } else {
             Ok(())
         }
diff --git a/src/librustc/mir/interpret/value.rs b/src/librustc/mir/interpret/value.rs
index 9379054bdfc..01db0e48e21 100644
--- a/src/librustc/mir/interpret/value.rs
+++ b/src/librustc/mir/interpret/value.rs
@@ -360,7 +360,7 @@ impl<'tcx, Tag> Scalar<Tag> {
                 Scalar::check_data(data, size);
                 Ok(data)
             }
-            Scalar::Ptr(_) => throw_err!(ReadPointerAsBytes),
+            Scalar::Ptr(_) => throw_err_unsup!(ReadPointerAsBytes),
         }
     }
 
@@ -373,8 +373,8 @@ impl<'tcx, Tag> Scalar<Tag> {
     #[inline]
     pub fn to_ptr(self) -> InterpResult<'tcx, Pointer<Tag>> {
         match self {
-            Scalar::Raw { data: 0, .. } => throw_err!(InvalidNullPointerUsage),
-            Scalar::Raw { .. } => throw_err!(ReadBytesAsPointer),
+            Scalar::Raw { data: 0, .. } => throw_err_unsup!(InvalidNullPointerUsage),
+            Scalar::Raw { .. } => throw_err_unsup!(ReadBytesAsPointer),
             Scalar::Ptr(p) => Ok(p),
         }
     }
@@ -406,7 +406,7 @@ impl<'tcx, Tag> Scalar<Tag> {
         match self {
             Scalar::Raw { data: 0, size: 1 } => Ok(false),
             Scalar::Raw { data: 1, size: 1 } => Ok(true),
-            _ => throw_err!(InvalidBool),
+            _ => throw_err_unsup!(InvalidBool),
         }
     }
 
@@ -414,7 +414,7 @@ impl<'tcx, Tag> Scalar<Tag> {
         let val = self.to_u32()?;
         match ::std::char::from_u32(val) {
             Some(c) => Ok(c),
-            None => throw_err!(InvalidChar(val as u128)),
+            None => throw_err_unsup!(InvalidChar(val as u128)),
         }
     }
 
@@ -537,7 +537,7 @@ impl<'tcx, Tag> ScalarMaybeUndef<Tag> {
     pub fn not_undef(self) -> InterpResult<'static, Scalar<Tag>> {
         match self {
             ScalarMaybeUndef::Scalar(scalar) => Ok(scalar),
-            ScalarMaybeUndef::Undef => throw_err!(ReadUndefBytes(Size::from_bytes(0))),
+            ScalarMaybeUndef::Undef => throw_err_unsup!(ReadUndefBytes(Size::from_bytes(0))),
         }
     }