@@ -44,14 +44,14 @@ CloneTypeFoldableImpls! {
44
44
pub type ConstEvalRawResult < ' tcx > = Result < RawConst < ' tcx > , ErrorHandled > ;
45
45
pub type ConstEvalResult < ' tcx > = Result < & ' tcx ty:: Const < ' tcx > , ErrorHandled > ;
46
46
47
- #[ derive( Clone , Debug , RustcEncodable , RustcDecodable ) ]
47
+ #[ derive( Clone , Debug ) ]
48
48
pub struct ConstEvalErr < ' tcx > {
49
49
pub span : Span ,
50
50
pub error : crate :: mir:: interpret:: InterpError < ' tcx > ,
51
51
pub stacktrace : Vec < FrameInfo < ' tcx > > ,
52
52
}
53
53
54
- #[ derive( Clone , Debug , RustcEncodable , RustcDecodable , HashStable ) ]
54
+ #[ derive( Clone , Debug ) ]
55
55
pub struct FrameInfo < ' tcx > {
56
56
/// This span is in the caller.
57
57
pub call_site : Span ,
@@ -331,7 +331,7 @@ impl<O: fmt::Debug> fmt::Debug for PanicInfo<O> {
331
331
/// Error information for when the program we executed turned out not to actually be a valid
332
332
/// program. This cannot happen in stand-alone Miri, but it can happen during CTFE/ConstProp
333
333
/// where we work on generic code or execution does not have all information available.
334
- #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
334
+ #[ derive( Clone , HashStable ) ]
335
335
pub enum InvalidProgramInfo < ' tcx > {
336
336
/// Resolution can fail if we are in a too generic context.
337
337
TooGeneric ,
@@ -361,7 +361,7 @@ impl fmt::Debug for InvalidProgramInfo<'tcx> {
361
361
}
362
362
363
363
/// Error information for when the program caused Undefined Behavior.
364
- #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
364
+ #[ derive( Clone , HashStable ) ]
365
365
pub enum UndefinedBehaviorInfo {
366
366
/// Free-form case. Only for errors that are never caught!
367
367
Ub ( String ) ,
@@ -394,11 +394,15 @@ impl fmt::Debug for UndefinedBehaviorInfo {
394
394
///
395
395
/// Currently, we also use this as fall-back error kind for errors that have not been
396
396
/// categorized yet.
397
- #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
397
+ #[ derive( Clone , HashStable ) ]
398
398
pub enum UnsupportedOpInfo < ' tcx > {
399
399
/// Free-form case. Only for errors that are never caught!
400
400
Unsupported ( String ) ,
401
401
402
+ /// When const-prop encounters a situation it does not support, it raises this error.
403
+ /// This must not allocate for performance reasons.
404
+ ConstPropUnsupported ( & ' tcx str ) ,
405
+
402
406
// -- Everything below is not categorized yet --
403
407
FunctionAbiMismatch ( Abi , Abi ) ,
404
408
FunctionArgMismatch ( Ty < ' tcx > , Ty < ' tcx > ) ,
@@ -559,13 +563,15 @@ impl fmt::Debug for UnsupportedOpInfo<'tcx> {
559
563
not a power of two") ,
560
564
Unsupported ( ref msg) =>
561
565
write ! ( f, "{}" , msg) ,
566
+ ConstPropUnsupported ( ref msg) =>
567
+ write ! ( f, "Constant propagation encountered an unsupported situation: {}" , msg) ,
562
568
}
563
569
}
564
570
}
565
571
566
572
/// Error information for when the program exhausted the resources granted to it
567
573
/// by the interpreter.
568
- #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
574
+ #[ derive( Clone , HashStable ) ]
569
575
pub enum ResourceExhaustionInfo {
570
576
/// The stack grew too big.
571
577
StackFrameLimitReached ,
@@ -586,7 +592,7 @@ impl fmt::Debug for ResourceExhaustionInfo {
586
592
}
587
593
}
588
594
589
- #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
595
+ #[ derive( Clone , HashStable ) ]
590
596
pub enum InterpError < ' tcx > {
591
597
/// The program panicked.
592
598
Panic ( PanicInfo < u64 > ) ,
0 commit comments