@@ -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 ,
@@ -327,7 +327,7 @@ impl<O: fmt::Debug> fmt::Debug for PanicInfo<O> {
327327/// Error information for when the program we executed turned out not to actually be a valid
328328/// program. This cannot happen in stand-alone Miri, but it can happen during CTFE/ConstProp
329329/// where we work on generic code or execution does not have all information available.
330- #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
330+ #[ derive( Clone , HashStable ) ]
331331pub enum InvalidProgramInfo < ' tcx > {
332332 /// Resolution can fail if we are in a too generic context.
333333 TooGeneric ,
@@ -357,7 +357,7 @@ impl fmt::Debug for InvalidProgramInfo<'tcx> {
357357}
358358
359359/// Error information for when the program caused Undefined Behavior.
360- #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
360+ #[ derive( Clone , HashStable ) ]
361361pub enum UndefinedBehaviorInfo {
362362 /// Free-form case. Only for errors that are never caught!
363363 Ub ( String ) ,
@@ -390,11 +390,15 @@ impl fmt::Debug for UndefinedBehaviorInfo {
390390///
391391/// Currently, we also use this as fall-back error kind for errors that have not been
392392/// categorized yet.
393- #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
393+ #[ derive( Clone , HashStable ) ]
394394pub enum UnsupportedOpInfo < ' tcx > {
395395 /// Free-form case. Only for errors that are never caught!
396396 Unsupported ( String ) ,
397397
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+
398402 // -- Everything below is not categorized yet --
399403 FunctionAbiMismatch ( Abi , Abi ) ,
400404 FunctionArgMismatch ( Ty < ' tcx > , Ty < ' tcx > ) ,
@@ -555,13 +559,15 @@ impl fmt::Debug for UnsupportedOpInfo<'tcx> {
555559 not a power of two") ,
556560 Unsupported ( ref msg) =>
557561 write ! ( f, "{}" , msg) ,
562+ ConstPropUnsupported ( ref msg) =>
563+ write ! ( f, "Constant propagation encountered an unsupported situation: {}" , msg) ,
558564 }
559565 }
560566}
561567
562568/// Error information for when the program exhausted the resources granted to it
563569/// by the interpreter.
564- #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
570+ #[ derive( Clone , HashStable ) ]
565571pub enum ResourceExhaustionInfo {
566572 /// The stack grew too big.
567573 StackFrameLimitReached ,
@@ -582,7 +588,7 @@ impl fmt::Debug for ResourceExhaustionInfo {
582588 }
583589}
584590
585- #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
591+ #[ derive( Clone , HashStable ) ]
586592pub enum InterpError < ' tcx > {
587593 /// The program panicked.
588594 Panic ( PanicInfo < u64 > ) ,
0 commit comments