Skip to content

Commit 21c2b71

Browse files
committed
Remove unused error variants
1 parent 64e6dda commit 21c2b71

File tree

3 files changed

+1
-31
lines changed

3 files changed

+1
-31
lines changed

src/librustc/ich/impls_const_math.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,11 @@ impl_stable_hash_for!(struct ::rustc_const_math::ConstFloat {
1717
});
1818

1919
impl_stable_hash_for!(enum ::rustc_const_math::ConstMathErr {
20-
NotInRange,
2120
CmpBetweenUnequalTypes,
2221
UnequalTypes(op),
2322
Overflow(op),
24-
ShiftNegative,
2523
DivisionByZero,
2624
RemainderByZero,
27-
UnsignedNegation,
28-
ULitOutOfRange(int_ty),
29-
LitOutOfRange(int_ty)
3025
});
3126

3227
impl_stable_hash_for!(enum ::rustc_const_math::Op {

src/librustc/middle/const_val.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,7 @@ pub struct FrameInfo {
7878

7979
impl<'tcx> From<ConstMathErr> for ErrKind<'tcx> {
8080
fn from(err: ConstMathErr) -> ErrKind<'tcx> {
81-
match err {
82-
ConstMathErr::UnsignedNegation => ErrKind::TypeckError,
83-
_ => ErrKind::Math(err)
84-
}
81+
ErrKind::Math(err)
8582
}
8683
}
8784

src/librustc_const_math/err.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,13 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use syntax::ast;
12-
1311
#[derive(Debug, PartialEq, Eq, Clone, RustcEncodable, RustcDecodable)]
1412
pub enum ConstMathErr {
15-
NotInRange,
1613
CmpBetweenUnequalTypes,
1714
UnequalTypes(Op),
1815
Overflow(Op),
19-
ShiftNegative,
2016
DivisionByZero,
2117
RemainderByZero,
22-
UnsignedNegation,
23-
ULitOutOfRange(ast::UintTy),
24-
LitOutOfRange(ast::IntTy),
2518
}
2619
pub use self::ConstMathErr::*;
2720

@@ -44,7 +37,6 @@ impl ConstMathErr {
4437
pub fn description(&self) -> &'static str {
4538
use self::Op::*;
4639
match *self {
47-
NotInRange => "inferred value out of range",
4840
CmpBetweenUnequalTypes => "compared two values of different types",
4941
UnequalTypes(Add) => "tried to add two values of different types",
5042
UnequalTypes(Sub) => "tried to subtract two values of different types",
@@ -66,22 +58,8 @@ impl ConstMathErr {
6658
Overflow(Shr) => "attempt to shift right with overflow",
6759
Overflow(Shl) => "attempt to shift left with overflow",
6860
Overflow(_) => unreachable!(),
69-
ShiftNegative => "attempt to shift by a negative amount",
7061
DivisionByZero => "attempt to divide by zero",
7162
RemainderByZero => "attempt to calculate the remainder with a divisor of zero",
72-
UnsignedNegation => "unary negation of unsigned integer",
73-
ULitOutOfRange(ast::UintTy::U8) => "literal out of range for u8",
74-
ULitOutOfRange(ast::UintTy::U16) => "literal out of range for u16",
75-
ULitOutOfRange(ast::UintTy::U32) => "literal out of range for u32",
76-
ULitOutOfRange(ast::UintTy::U64) => "literal out of range for u64",
77-
ULitOutOfRange(ast::UintTy::U128) => "literal out of range for u128",
78-
ULitOutOfRange(ast::UintTy::Usize) => "literal out of range for usize",
79-
LitOutOfRange(ast::IntTy::I8) => "literal out of range for i8",
80-
LitOutOfRange(ast::IntTy::I16) => "literal out of range for i16",
81-
LitOutOfRange(ast::IntTy::I32) => "literal out of range for i32",
82-
LitOutOfRange(ast::IntTy::I64) => "literal out of range for i64",
83-
LitOutOfRange(ast::IntTy::I128) => "literal out of range for i128",
84-
LitOutOfRange(ast::IntTy::Isize) => "literal out of range for isize",
8563
}
8664
}
8765
}

0 commit comments

Comments
 (0)