From 6e5951c7343cc1addecffb7de97b89c15a7030dd Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Mon, 25 Jun 2018 15:10:33 +0200 Subject: [PATCH] Remove unused type --- src/librustc/middle/const_val.rs | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/librustc/middle/const_val.rs b/src/librustc/middle/const_val.rs index 94273287f07..c39422d21c0 100644 --- a/src/librustc/middle/const_val.rs +++ b/src/librustc/middle/const_val.rs @@ -15,11 +15,9 @@ use mir::interpret::ConstValue; use errors::DiagnosticBuilder; -use graphviz::IntoCow; use syntax_pos::Span; use syntax::ast; -use std::borrow::Cow; use rustc_data_structures::sync::Lrc; pub type EvalResult<'tcx> = Result<&'tcx ty::Const<'tcx>, ConstEvalErr<'tcx>>; @@ -43,22 +41,6 @@ pub struct FrameInfo { pub lint_root: Option, } -#[derive(Clone, Debug)] -pub enum ConstEvalErrDescription<'a, 'tcx: 'a> { - Simple(Cow<'a, str>), - Backtrace(&'a ::mir::interpret::EvalError<'tcx>, &'a [FrameInfo]), -} - -impl<'a, 'tcx> ConstEvalErrDescription<'a, 'tcx> { - /// Return a one-line description of the error, for lints and such - pub fn into_oneline(self) -> Cow<'a, str> { - match self { - ConstEvalErrDescription::Simple(simple) => simple, - ConstEvalErrDescription::Backtrace(miri, _) => format!("{}", miri).into_cow(), - } - } -} - impl<'a, 'gcx, 'tcx> ConstEvalErr<'tcx> { pub fn struct_error(&self, tcx: TyCtxtAt<'a, 'gcx, 'tcx>,