about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>2018-04-24 14:17:05 +0200
committerOliver Schneider <git-no-reply-9879165716479413131@oli-obk.de>2018-04-30 18:18:32 +0200
commit21c2b714056f5c6fee634b87f3f4c05ac1a85bec (patch)
treef7887419cabda429e0ad742d6b44043645ffbcb8
parent64e6dda0bce96da47e52f7f3e278d05f7a09473c (diff)
downloadrust-21c2b714056f5c6fee634b87f3f4c05ac1a85bec.tar.gz
rust-21c2b714056f5c6fee634b87f3f4c05ac1a85bec.zip
Remove unused error variants
-rw-r--r--src/librustc/ich/impls_const_math.rs5
-rw-r--r--src/librustc/middle/const_val.rs5
-rw-r--r--src/librustc_const_math/err.rs22
3 files changed, 1 insertions, 31 deletions
diff --git a/src/librustc/ich/impls_const_math.rs b/src/librustc/ich/impls_const_math.rs
index 5f3ff461c0c..afa28ae319c 100644
--- a/src/librustc/ich/impls_const_math.rs
+++ b/src/librustc/ich/impls_const_math.rs
@@ -17,16 +17,11 @@ impl_stable_hash_for!(struct ::rustc_const_math::ConstFloat {
 });
 
 impl_stable_hash_for!(enum ::rustc_const_math::ConstMathErr {
-    NotInRange,
     CmpBetweenUnequalTypes,
     UnequalTypes(op),
     Overflow(op),
-    ShiftNegative,
     DivisionByZero,
     RemainderByZero,
-    UnsignedNegation,
-    ULitOutOfRange(int_ty),
-    LitOutOfRange(int_ty)
 });
 
 impl_stable_hash_for!(enum ::rustc_const_math::Op {
diff --git a/src/librustc/middle/const_val.rs b/src/librustc/middle/const_val.rs
index 19a7576b7ce..8a2126e356f 100644
--- a/src/librustc/middle/const_val.rs
+++ b/src/librustc/middle/const_val.rs
@@ -78,10 +78,7 @@ pub struct FrameInfo {
 
 impl<'tcx> From<ConstMathErr> for ErrKind<'tcx> {
     fn from(err: ConstMathErr) -> ErrKind<'tcx> {
-        match err {
-            ConstMathErr::UnsignedNegation => ErrKind::TypeckError,
-            _ => ErrKind::Math(err)
-        }
+        ErrKind::Math(err)
     }
 }
 
diff --git a/src/librustc_const_math/err.rs b/src/librustc_const_math/err.rs
index bd0a332436e..dee8813e86f 100644
--- a/src/librustc_const_math/err.rs
+++ b/src/librustc_const_math/err.rs
@@ -8,20 +8,13 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use syntax::ast;
-
 #[derive(Debug, PartialEq, Eq, Clone, RustcEncodable, RustcDecodable)]
 pub enum ConstMathErr {
-    NotInRange,
     CmpBetweenUnequalTypes,
     UnequalTypes(Op),
     Overflow(Op),
-    ShiftNegative,
     DivisionByZero,
     RemainderByZero,
-    UnsignedNegation,
-    ULitOutOfRange(ast::UintTy),
-    LitOutOfRange(ast::IntTy),
 }
 pub use self::ConstMathErr::*;
 
@@ -44,7 +37,6 @@ impl ConstMathErr {
     pub fn description(&self) -> &'static str {
         use self::Op::*;
         match *self {
-            NotInRange => "inferred value out of range",
             CmpBetweenUnequalTypes => "compared two values of different types",
             UnequalTypes(Add) => "tried to add two values of different types",
             UnequalTypes(Sub) => "tried to subtract two values of different types",
@@ -66,22 +58,8 @@ impl ConstMathErr {
             Overflow(Shr) => "attempt to shift right with overflow",
             Overflow(Shl) => "attempt to shift left with overflow",
             Overflow(_) => unreachable!(),
-            ShiftNegative => "attempt to shift by a negative amount",
             DivisionByZero => "attempt to divide by zero",
             RemainderByZero => "attempt to calculate the remainder with a divisor of zero",
-            UnsignedNegation => "unary negation of unsigned integer",
-            ULitOutOfRange(ast::UintTy::U8) => "literal out of range for u8",
-            ULitOutOfRange(ast::UintTy::U16) => "literal out of range for u16",
-            ULitOutOfRange(ast::UintTy::U32) => "literal out of range for u32",
-            ULitOutOfRange(ast::UintTy::U64) => "literal out of range for u64",
-            ULitOutOfRange(ast::UintTy::U128) => "literal out of range for u128",
-            ULitOutOfRange(ast::UintTy::Usize) => "literal out of range for usize",
-            LitOutOfRange(ast::IntTy::I8) => "literal out of range for i8",
-            LitOutOfRange(ast::IntTy::I16) => "literal out of range for i16",
-            LitOutOfRange(ast::IntTy::I32) => "literal out of range for i32",
-            LitOutOfRange(ast::IntTy::I64) => "literal out of range for i64",
-            LitOutOfRange(ast::IntTy::I128) => "literal out of range for i128",
-            LitOutOfRange(ast::IntTy::Isize) => "literal out of range for isize",
         }
     }
 }