@@ -44,14 +44,14 @@ CloneTypeFoldableImpls! {
4444pub type ConstEvalRawResult < ' tcx > = Result < RawConst < ' tcx > , ErrorHandled > ;
4545pub type ConstEvalResult < ' tcx > = Result < & ' tcx ty:: Const < ' tcx > , ErrorHandled > ;
4646
47- #[ derive( Clone , Debug , RustcEncodable , RustcDecodable ) ]
47+ #[ derive( Clone , Debug ) ]
4848pub struct ConstEvalErr < ' tcx > {
4949 pub span : Span ,
5050 pub error : crate :: mir:: interpret:: InterpError < ' tcx > ,
5151 pub stacktrace : Vec < FrameInfo < ' tcx > > ,
5252}
5353
54- #[ derive( Clone , Debug , RustcEncodable , RustcDecodable , HashStable ) ]
54+ #[ derive( Clone , Debug ) ]
5555pub struct FrameInfo < ' tcx > {
5656 /// This span is in the caller.
5757 pub call_site : Span ,
@@ -331,7 +331,7 @@ impl<O: fmt::Debug> fmt::Debug for PanicInfo<O> {
331331/// Error information for when the program we executed turned out not to actually be a valid
332332/// program. This cannot happen in stand-alone Miri, but it can happen during CTFE/ConstProp
333333/// where we work on generic code or execution does not have all information available.
334- #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
334+ #[ derive( Clone , HashStable ) ]
335335pub enum InvalidProgramInfo < ' tcx > {
336336 /// Resolution can fail if we are in a too generic context.
337337 TooGeneric ,
@@ -361,7 +361,7 @@ impl fmt::Debug for InvalidProgramInfo<'tcx> {
361361}
362362
363363/// Error information for when the program caused Undefined Behavior.
364- #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
364+ #[ derive( Clone , HashStable ) ]
365365pub enum UndefinedBehaviorInfo {
366366 /// Free-form case. Only for errors that are never caught!
367367 Ub ( String ) ,
@@ -394,11 +394,15 @@ impl fmt::Debug for UndefinedBehaviorInfo {
394394///
395395/// Currently, we also use this as fall-back error kind for errors that have not been
396396/// categorized yet.
397- #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
397+ #[ derive( Clone , HashStable ) ]
398398pub enum UnsupportedOpInfo < ' tcx > {
399399 /// Free-form case. Only for errors that are never caught!
400400 Unsupported ( String ) ,
401401
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+
402406 // -- Everything below is not categorized yet --
403407 FunctionAbiMismatch ( Abi , Abi ) ,
404408 FunctionArgMismatch ( Ty < ' tcx > , Ty < ' tcx > ) ,
@@ -559,13 +563,15 @@ impl fmt::Debug for UnsupportedOpInfo<'tcx> {
559563 not a power of two") ,
560564 Unsupported ( ref msg) =>
561565 write ! ( f, "{}" , msg) ,
566+ ConstPropUnsupported ( ref msg) =>
567+ write ! ( f, "Constant propagation encountered an unsupported situation: {}" , msg) ,
562568 }
563569 }
564570}
565571
566572/// Error information for when the program exhausted the resources granted to it
567573/// by the interpreter.
568- #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
574+ #[ derive( Clone , HashStable ) ]
569575pub enum ResourceExhaustionInfo {
570576 /// The stack grew too big.
571577 StackFrameLimitReached ,
@@ -586,7 +592,7 @@ impl fmt::Debug for ResourceExhaustionInfo {
586592 }
587593}
588594
589- #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
595+ #[ derive( Clone , HashStable ) ]
590596pub enum InterpError < ' tcx > {
591597 /// The program panicked.
592598 Panic ( PanicInfo < u64 > ) ,
0 commit comments