@@ -15,11 +15,9 @@ use ty::query::TyCtxtAt;
15
15
use mir:: interpret:: ConstValue ;
16
16
use errors:: DiagnosticBuilder ;
17
17
18
- use graphviz:: IntoCow ;
19
18
use syntax_pos:: Span ;
20
19
use syntax:: ast;
21
20
22
- use std:: borrow:: Cow ;
23
21
use rustc_data_structures:: sync:: Lrc ;
24
22
25
23
pub type EvalResult < ' tcx > = Result < & ' tcx ty:: Const < ' tcx > , ConstEvalErr < ' tcx > > ;
@@ -43,22 +41,6 @@ pub struct FrameInfo {
43
41
pub lint_root : Option < ast:: NodeId > ,
44
42
}
45
43
46
- #[ derive( Clone , Debug ) ]
47
- pub enum ConstEvalErrDescription < ' a , ' tcx : ' a > {
48
- Simple ( Cow < ' a , str > ) ,
49
- Backtrace ( & ' a :: mir:: interpret:: EvalError < ' tcx > , & ' a [ FrameInfo ] ) ,
50
- }
51
-
52
- impl < ' a , ' tcx > ConstEvalErrDescription < ' a , ' tcx > {
53
- /// Return a one-line description of the error, for lints and such
54
- pub fn into_oneline ( self ) -> Cow < ' a , str > {
55
- match self {
56
- ConstEvalErrDescription :: Simple ( simple) => simple,
57
- ConstEvalErrDescription :: Backtrace ( miri, _) => format ! ( "{}" , miri) . into_cow ( ) ,
58
- }
59
- }
60
- }
61
-
62
44
impl < ' a , ' gcx , ' tcx > ConstEvalErr < ' tcx > {
63
45
pub fn struct_error ( & self ,
64
46
tcx : TyCtxtAt < ' a , ' gcx , ' tcx > ,
0 commit comments