From 848080dc42a0080fc4dc1d29556aaddbbc3e5bd5 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Tue, 5 Jun 2018 19:02:03 +0200 Subject: [PATCH] Remove unused IndexOutOfBounds variant --- src/librustc/ich/impls_ty.rs | 4 ---- src/librustc/middle/const_val.rs | 7 ------- src/librustc/ty/structural_impls.rs | 2 -- 3 files changed, 13 deletions(-) diff --git a/src/librustc/ich/impls_ty.rs b/src/librustc/ich/impls_ty.rs index 592ada83c852..fe19196fe06f 100644 --- a/src/librustc/ich/impls_ty.rs +++ b/src/librustc/ich/impls_ty.rs @@ -530,10 +530,6 @@ for ::middle::const_val::ErrKind<'gcx> { CheckMatchError => { // nothing to do } - IndexOutOfBounds { len, index } => { - len.hash_stable(hcx, hasher); - index.hash_stable(hcx, hasher); - } Miri(ref err, ref trace) => { err.hash_stable(hcx, hasher); trace.hash_stable(hcx, hasher); diff --git a/src/librustc/middle/const_val.rs b/src/librustc/middle/const_val.rs index d2c6bb289485..3abe405d5984 100644 --- a/src/librustc/middle/const_val.rs +++ b/src/librustc/middle/const_val.rs @@ -41,8 +41,6 @@ pub enum ErrKind<'tcx> { NonConstPath, CouldNotResolve, - IndexOutOfBounds { len: u64, index: u64 }, - TypeckError, CheckMatchError, Miri(::mir::interpret::EvalError<'tcx>, Vec), @@ -86,11 +84,6 @@ impl<'a, 'gcx, 'tcx> ConstEvalErr<'tcx> { match *self.kind { NonConstPath => simple!("non-constant path in constant expression"), CouldNotResolve => simple!("could not resolve"), - IndexOutOfBounds { len, index } => { - simple!("index out of bounds: the len is {} but the index is {}", - len, index) - } - TypeckError => simple!("type-checking failed"), CheckMatchError => simple!("match-checking failed"), Miri(ref err, ref trace) => Backtrace(err, trace), diff --git a/src/librustc/ty/structural_impls.rs b/src/librustc/ty/structural_impls.rs index 537efcd9b59d..2055f11f9f8a 100644 --- a/src/librustc/ty/structural_impls.rs +++ b/src/librustc/ty/structural_impls.rs @@ -596,8 +596,6 @@ impl<'a, 'tcx> Lift<'tcx> for const_val::ErrKind<'a> { Some(match *self { NonConstPath => NonConstPath, CouldNotResolve => CouldNotResolve, - IndexOutOfBounds { len, index } => IndexOutOfBounds { len, index }, - TypeckError => TypeckError, CheckMatchError => CheckMatchError, Miri(ref e, ref frames) => return tcx.lift(e).map(|e| Miri(e, frames.clone())),