@@ -228,6 +228,24 @@ impl<'tcx> From<InterpError<'tcx, u64>> for InterpErrorInfo<'tcx> {
228228
229229pub type AssertMessage < ' tcx > = InterpError < ' tcx , mir:: Operand < ' tcx > > ;
230230
231+ #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
232+ pub enum EvalErrorPanic < O > {
233+ Panic {
234+ msg : Symbol ,
235+ line : u32 ,
236+ col : u32 ,
237+ file : Symbol ,
238+ } ,
239+ BoundsCheck {
240+ len : O ,
241+ index : O ,
242+ } ,
243+ Overflow ( mir:: BinOp ) ,
244+ OverflowNeg ,
245+ DivisionByZero ,
246+ RemainderByZero ,
247+ }
248+
231249#[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
232250pub enum InterpError < ' tcx , O > {
233251 /// This variant is used by machines to signal their own errors that do not
@@ -247,7 +265,6 @@ pub enum InterpError<'tcx, O> {
247265 DanglingPointerDeref ,
248266 DoubleFree ,
249267 InvalidMemoryAccess ,
250- FunctionPointerTyMismatch ( FnSig < ' tcx > , FnSig < ' tcx > ) ,
251268 InvalidFunctionPointer ,
252269 InvalidBool ,
253270 InvalidDiscriminant ( ScalarMaybeUndef ) ,
@@ -267,13 +284,11 @@ pub enum InterpError<'tcx, O> {
267284 Unimplemented ( String ) ,
268285 DerefFunctionPointer ,
269286 ExecuteMemory ,
270- // asd
271287 BoundsCheck { len : O , index : O } ,
272288 Overflow ( mir:: BinOp ) ,
273289 OverflowNeg ,
274290 DivisionByZero ,
275291 RemainderByZero ,
276- // asd
277292 Intrinsic ( String ) ,
278293 InvalidChar ( u128 ) ,
279294 StackFrameLimitReached ,
@@ -284,29 +299,6 @@ pub enum InterpError<'tcx, O> {
284299 required : Align ,
285300 has : Align ,
286301 } ,
287- MemoryLockViolation {
288- ptr : Pointer ,
289- len : u64 ,
290- frame : usize ,
291- access : AccessKind ,
292- lock : Lock ,
293- } ,
294- MemoryAcquireConflict {
295- ptr : Pointer ,
296- len : u64 ,
297- kind : AccessKind ,
298- lock : Lock ,
299- } ,
300- InvalidMemoryLockRelease {
301- ptr : Pointer ,
302- len : u64 ,
303- frame : usize ,
304- lock : Lock ,
305- } ,
306- DeallocatedLockedMemory {
307- ptr : Pointer ,
308- lock : Lock ,
309- } ,
310302 ValidationFailure ( String ) ,
311303 CalledClosureAsFunction ,
312304 VtableForArgumentlessMethod ,
@@ -324,7 +316,7 @@ pub enum InterpError<'tcx, O> {
324316 HeapAllocZeroBytes ,
325317 HeapAllocNonPowerOfTwoAlignment ( u64 ) ,
326318 Unreachable ,
327- Panic ( EvalErrorPanic < ' tcx , O > ) ,
319+ Panic ( EvalErrorPanic < O > ) ,
328320 ReadFromReturnPointer ,
329321 PathNotFound ( Vec < String > ) ,
330322 UnimplementedTraitSelection ,
@@ -340,15 +332,6 @@ pub enum InterpError<'tcx, O> {
340332 InfiniteLoop ,
341333}
342334
343- #[ derive( Clone , RustcEncodable , RustcDecodable ) ]
344- pub enum EvalErrorPanic < ' tcx , O > {
345- Panic ,
346- BoundsCheck { len : O , index : O } ,
347- Overflow ( mir:: BinOp ) ,
348- OverflowNeg ,
349- DivisionByZero ,
350- RemainderByZero ,
351- }
352335
353336pub type InterpResult < ' tcx , T = ( ) > = Result < T , InterpErrorInfo < ' tcx > > ;
354337
@@ -549,8 +532,8 @@ impl<'tcx, O: fmt::Debug> fmt::Debug for InterpError<'tcx, O> {
549532 write ! ( f, "incorrect alloc info: expected size {} and align {}, \
550533 got size {} and align {}",
551534 size. bytes( ) , align. bytes( ) , size2. bytes( ) , align2. bytes( ) ) ,
552- Panic { ref msg , line , col , ref file } =>
553- write ! ( f, "the evaluated program panicked at '{}', {}:{}:{}" , msg , file , line , col ) ,
535+ Panic { .. } =>
536+ write ! ( f, "the evaluated program panicked" ) ,
554537 InvalidDiscriminant ( val) =>
555538 write ! ( f, "encountered invalid enum discriminant {}" , val) ,
556539 Exit ( code) =>
0 commit comments