@@ -43,7 +43,7 @@ pub type ConstEvalResult<'tcx> = Result<ty::Const<'tcx>, ErrorHandled>;
43
43
#[ derive( Clone , Debug , RustcEncodable , RustcDecodable ) ]
44
44
pub struct ConstEvalErr < ' tcx > {
45
45
pub span : Span ,
46
- pub error : crate :: mir:: interpret:: EvalErrorKind < ' tcx , u64 > ,
46
+ pub error : crate :: mir:: interpret:: InterpError < ' tcx , u64 > ,
47
47
pub stacktrace : Vec < FrameInfo < ' tcx > > ,
48
48
}
49
49
@@ -135,10 +135,10 @@ impl<'a, 'gcx, 'tcx> ConstEvalErr<'tcx> {
135
135
lint_root : Option < hir:: HirId > ,
136
136
) -> Result < DiagnosticBuilder < ' tcx > , ErrorHandled > {
137
137
match self . error {
138
- EvalErrorKind :: Layout ( LayoutError :: Unknown ( _) ) |
139
- EvalErrorKind :: TooGeneric => return Err ( ErrorHandled :: TooGeneric ) ,
140
- EvalErrorKind :: Layout ( LayoutError :: SizeOverflow ( _) ) |
141
- EvalErrorKind :: TypeckError => return Err ( ErrorHandled :: Reported ) ,
138
+ InterpError :: Layout ( LayoutError :: Unknown ( _) ) |
139
+ InterpError :: TooGeneric => return Err ( ErrorHandled :: TooGeneric ) ,
140
+ InterpError :: Layout ( LayoutError :: SizeOverflow ( _) ) |
141
+ InterpError :: TypeckError => return Err ( ErrorHandled :: Reported ) ,
142
142
_ => { } ,
143
143
}
144
144
trace ! ( "reporting const eval failure at {:?}" , self . span) ;
@@ -180,7 +180,7 @@ pub fn struct_error<'a, 'gcx, 'tcx>(
180
180
181
181
#[ derive( Debug , Clone ) ]
182
182
pub struct EvalError < ' tcx > {
183
- pub kind : EvalErrorKind < ' tcx , u64 > ,
183
+ pub kind : InterpError < ' tcx , u64 > ,
184
184
pub backtrace : Option < Box < Backtrace > > ,
185
185
}
186
186
@@ -197,8 +197,8 @@ fn print_backtrace(backtrace: &mut Backtrace) {
197
197
eprintln ! ( "\n \n An error occurred in miri:\n {:?}" , backtrace) ;
198
198
}
199
199
200
- impl < ' tcx > From < EvalErrorKind < ' tcx , u64 > > for EvalError < ' tcx > {
201
- fn from ( kind : EvalErrorKind < ' tcx , u64 > ) -> Self {
200
+ impl < ' tcx > From < InterpError < ' tcx , u64 > > for EvalError < ' tcx > {
201
+ fn from ( kind : InterpError < ' tcx , u64 > ) -> Self {
202
202
let backtrace = match env:: var ( "RUST_CTFE_BACKTRACE" ) {
203
203
// matching RUST_BACKTRACE, we treat "0" the same as "not present".
204
204
Ok ( ref val) if val != "0" => {
@@ -221,10 +221,10 @@ impl<'tcx> From<EvalErrorKind<'tcx, u64>> for EvalError<'tcx> {
221
221
}
222
222
}
223
223
224
- pub type AssertMessage < ' tcx > = EvalErrorKind < ' tcx , mir:: Operand < ' tcx > > ;
224
+ pub type AssertMessage < ' tcx > = InterpError < ' tcx , mir:: Operand < ' tcx > > ;
225
225
226
226
#[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
227
- pub enum EvalErrorKind < ' tcx , O > {
227
+ pub enum InterpError < ' tcx , O > {
228
228
/// This variant is used by machines to signal their own errors that do not
229
229
/// match an existing variant.
230
230
MachineError ( String ) ,
@@ -312,9 +312,9 @@ pub enum EvalErrorKind<'tcx, O> {
312
312
313
313
pub type EvalResult < ' tcx , T = ( ) > = Result < T , EvalError < ' tcx > > ;
314
314
315
- impl < ' tcx , O > EvalErrorKind < ' tcx , O > {
315
+ impl < ' tcx , O > InterpError < ' tcx , O > {
316
316
pub fn description ( & self ) -> & str {
317
- use self :: EvalErrorKind :: * ;
317
+ use self :: InterpError :: * ;
318
318
match * self {
319
319
MachineError ( ref inner) => inner,
320
320
FunctionAbiMismatch ( ..) | FunctionArgMismatch ( ..) | FunctionRetMismatch ( ..)
@@ -450,15 +450,15 @@ impl<'tcx> fmt::Display for EvalError<'tcx> {
450
450
}
451
451
}
452
452
453
- impl < ' tcx > fmt:: Display for EvalErrorKind < ' tcx , u64 > {
453
+ impl < ' tcx > fmt:: Display for InterpError < ' tcx , u64 > {
454
454
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
455
455
write ! ( f, "{:?}" , self )
456
456
}
457
457
}
458
458
459
- impl < ' tcx , O : fmt:: Debug > fmt:: Debug for EvalErrorKind < ' tcx , O > {
459
+ impl < ' tcx , O : fmt:: Debug > fmt:: Debug for InterpError < ' tcx , O > {
460
460
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
461
- use self :: EvalErrorKind :: * ;
461
+ use self :: InterpError :: * ;
462
462
match * self {
463
463
PointerOutOfBounds { ptr, check, allocation_size } => {
464
464
write ! ( f, "Pointer must be in-bounds{} at offset {}, but is outside bounds of \
0 commit comments