Remove unused const error variant
This commit is contained in:
parent
0aa6e039d0
commit
d1d8d999ba
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
@ -62,7 +61,6 @@ pub enum ErrKind<'tcx> {
|
||||
UnimplementedConstVal(&'static str),
|
||||
IndexOutOfBounds { len: u64, index: u64 },
|
||||
|
||||
Math(ConstMathErr),
|
||||
LayoutError(layout::LayoutError<'tcx>),
|
||||
|
||||
TypeckError,
|
||||
@ -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>),
|
||||
@ -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"),
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user