@@ -359,31 +359,6 @@ pub enum UnsupportedInfo<'tcx> {
359
359
UnimplementedTraitSelection ,
360
360
CalledClosureAsFunction ,
361
361
NoMirFor ( String ) ,
362
- }
363
-
364
- #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
365
- pub enum ResourceExhaustionInfo {
366
- StackFrameLimitReached ,
367
- InfiniteLoop ,
368
- }
369
-
370
- #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
371
- pub enum InterpError < ' tcx > {
372
- /// The program panicked.
373
- Panic ( PanicMessage < u64 > ) ,
374
- /// The program caused undefined behavior.
375
- UndefinedBehaviour ( UndefinedBehaviourInfo ) ,
376
- /// The program did something the interpreter does not support (some of these *might* be UB
377
- /// but the interpreter is not sure).
378
- Unsupported ( UnsupportedInfo < ' tcx > ) ,
379
- /// The program was invalid (ill-typed, not sufficiently monomorphized, ...).
380
- InvalidProgram ( InvalidProgramInfo < ' tcx > ) ,
381
- /// The program exhausted the interpreter's resources (stack/heap too big,
382
- /// execution takes too long, ..).
383
- ResourceExhaustion ( ResourceExhaustionInfo ) ,
384
-
385
- /// THe above 5 variants are what we want to group all the remaining InterpError variants into
386
-
387
362
/// This variant is used by machines to signal their own errors that do not
388
363
/// match an existing variant.
389
364
MachineError ( String ) ,
@@ -421,6 +396,28 @@ pub enum InterpError<'tcx> {
421
396
PathNotFound ( Vec < String > ) ,
422
397
}
423
398
399
+ #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
400
+ pub enum ResourceExhaustionInfo {
401
+ StackFrameLimitReached ,
402
+ InfiniteLoop ,
403
+ }
404
+
405
+ #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
406
+ pub enum InterpError < ' tcx > {
407
+ /// The program panicked.
408
+ Panic ( PanicMessage < u64 > ) ,
409
+ /// The program caused undefined behavior.
410
+ UndefinedBehaviour ( UndefinedBehaviourInfo ) ,
411
+ /// The program did something the interpreter does not support (some of these *might* be UB
412
+ /// but the interpreter is not sure).
413
+ Unsupported ( UnsupportedInfo < ' tcx > ) ,
414
+ /// The program was invalid (ill-typed, not sufficiently monomorphized, ...).
415
+ InvalidProgram ( InvalidProgramInfo < ' tcx > ) ,
416
+ /// The program exhausted the interpreter's resources (stack/heap too big,
417
+ /// execution takes too long, ..).
418
+ ResourceExhaustion ( ResourceExhaustionInfo ) ,
419
+ }
420
+
424
421
pub type InterpResult < ' tcx , T = ( ) > = Result < T , InterpErrorInfo < ' tcx > > ;
425
422
426
423
impl fmt:: Display for InterpError < ' _ > {
0 commit comments