Skip to content

Commit

Permalink
Remove unused const error variant
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Apr 30, 2018
1 parent 0aa6e03 commit d1d8d99
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 13 deletions.
3 changes: 0 additions & 3 deletions src/librustc/ich/impls_ty.rs
Expand Up @@ -505,9 +505,6 @@ for ::middle::const_val::ErrKind<'gcx> {
len.hash_stable(hcx, hasher);
index.hash_stable(hcx, hasher);
}
Math(ref const_math_err) => {
const_math_err.hash_stable(hcx, hasher);
}
LayoutError(ref layout_error) => {
layout_error.hash_stable(hcx, hasher);
}
Expand Down
9 changes: 0 additions & 9 deletions src/librustc/middle/const_val.rs
Expand Up @@ -11,7 +11,6 @@
use hir::def_id::DefId;
use ty::{self, TyCtxt, layout};
use ty::subst::Substs;
use rustc_const_math::*;
use mir::interpret::{Value, PrimVal};
use errors::DiagnosticBuilder;

Expand Down Expand Up @@ -62,7 +61,6 @@ pub enum ErrKind<'tcx> {
UnimplementedConstVal(&'static str),
IndexOutOfBounds { len: u64, index: u64 },

Math(ConstMathErr),
LayoutError(layout::LayoutError<'tcx>),

TypeckError,
Expand All @@ -76,12 +74,6 @@ pub struct FrameInfo {
pub location: String,
}

impl<'tcx> From<ConstMathErr> for ErrKind<'tcx> {
fn from(err: ConstMathErr) -> ErrKind<'tcx> {
ErrKind::Math(err)
}
}

#[derive(Clone, Debug)]
pub enum ConstEvalErrDescription<'a, 'tcx: 'a> {
Simple(Cow<'a, str>),
Expand Down Expand Up @@ -119,7 +111,6 @@ impl<'a, 'gcx, 'tcx> ConstEvalErr<'tcx> {
len, index)
}

Math(ref err) => Simple(err.description().into_cow()),
LayoutError(ref err) => Simple(err.to_string().into_cow()),

TypeckError => simple!("type-checking failed"),
Expand Down
1 change: 0 additions & 1 deletion src/librustc/ty/structural_impls.rs
Expand Up @@ -585,7 +585,6 @@ impl<'a, 'tcx> Lift<'tcx> for const_val::ErrKind<'a> {
NonConstPath => NonConstPath,
UnimplementedConstVal(s) => UnimplementedConstVal(s),
IndexOutOfBounds { len, index } => IndexOutOfBounds { len, index },
Math(ref e) => Math(e.clone()),

LayoutError(ref e) => {
return tcx.lift(e).map(LayoutError)
Expand Down

0 comments on commit d1d8d99

Please sign in to comment.