File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ use std::{iter, thread};
1010
1111use rustc_abi:: ExternAbi ;
1212use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
13+ use rustc_errors:: FatalErrorMarker ;
1314use rustc_hir:: def:: Namespace ;
1415use rustc_hir:: def_id:: DefId ;
1516use rustc_middle:: ty:: layout:: { HasTyCtxt , HasTypingEnv , LayoutCx } ;
@@ -477,7 +478,11 @@ pub fn eval_entry<'tcx>(
477478 let res: thread:: Result < InterpResult < ' _ , !> > =
478479 panic:: catch_unwind ( AssertUnwindSafe ( || ecx. run_threads ( ) ) ) ;
479480 let res = res. unwrap_or_else ( |panic_payload| {
480- ecx. handle_ice ( ) ;
481+ // rustc "handles" some errors by unwinding with FatalErrorMarker
482+ // (after emitting suitable diagnostics), so do not treat those as ICEs.
483+ if !panic_payload. is :: < FatalErrorMarker > ( ) {
484+ ecx. handle_ice ( ) ;
485+ }
481486 panic:: resume_unwind ( panic_payload)
482487 } ) ;
483488 // Obtain the result of the execution. This is always an `Err`, but that doesn't necessarily
You can’t perform that action at this time.
0 commit comments