@@ -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 ,
@@ -327,7 +327,7 @@ impl<O: fmt::Debug> fmt::Debug for PanicInfo<O> {
327
327
/// Error information for when the program we executed turned out not to actually be a valid
328
328
/// program. This cannot happen in stand-alone Miri, but it can happen during CTFE/ConstProp
329
329
/// where we work on generic code or execution does not have all information available.
330
- #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
330
+ #[ derive( Clone , HashStable ) ]
331
331
pub enum InvalidProgramInfo < ' tcx > {
332
332
/// Resolution can fail if we are in a too generic context.
333
333
TooGeneric ,
@@ -357,7 +357,7 @@ impl fmt::Debug for InvalidProgramInfo<'tcx> {
357
357
}
358
358
359
359
/// Error information for when the program caused Undefined Behavior.
360
- #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
360
+ #[ derive( Clone , HashStable ) ]
361
361
pub enum UndefinedBehaviorInfo {
362
362
/// Free-form case. Only for errors that are never caught!
363
363
Ub ( String ) ,
@@ -390,11 +390,15 @@ impl fmt::Debug for UndefinedBehaviorInfo {
390
390
///
391
391
/// Currently, we also use this as fall-back error kind for errors that have not been
392
392
/// categorized yet.
393
- #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
393
+ #[ derive( Clone , HashStable ) ]
394
394
pub enum UnsupportedOpInfo < ' tcx > {
395
395
/// Free-form case. Only for errors that are never caught!
396
396
Unsupported ( String ) ,
397
397
398
+ /// When const-prop encounters a situation it does not support, it raises this error.
399
+ /// This must not allocate for performance reasons.
400
+ ConstPropUnsupported ( & ' tcx str ) ,
401
+
398
402
// -- Everything below is not categorized yet --
399
403
FunctionAbiMismatch ( Abi , Abi ) ,
400
404
FunctionArgMismatch ( Ty < ' tcx > , Ty < ' tcx > ) ,
@@ -555,13 +559,15 @@ impl fmt::Debug for UnsupportedOpInfo<'tcx> {
555
559
not a power of two") ,
556
560
Unsupported ( ref msg) =>
557
561
write ! ( f, "{}" , msg) ,
562
+ ConstPropUnsupported ( ref msg) =>
563
+ write ! ( f, "Constant propagation encountered an unsupported situation: {}" , msg) ,
558
564
}
559
565
}
560
566
}
561
567
562
568
/// Error information for when the program exhausted the resources granted to it
563
569
/// by the interpreter.
564
- #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
570
+ #[ derive( Clone , HashStable ) ]
565
571
pub enum ResourceExhaustionInfo {
566
572
/// The stack grew too big.
567
573
StackFrameLimitReached ,
@@ -582,7 +588,7 @@ impl fmt::Debug for ResourceExhaustionInfo {
582
588
}
583
589
}
584
590
585
- #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
591
+ #[ derive( Clone , HashStable ) ]
586
592
pub enum InterpError < ' tcx > {
587
593
/// The program panicked.
588
594
Panic ( PanicInfo < u64 > ) ,
0 commit comments