Skip to content

Commit 4fd1d97

Browse files
committed
Skip ICE message for fatal errors
1 parent 043bd76 commit 4fd1d97

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/tools/miri/src/eval.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use std::{iter, thread};
1010

1111
use rustc_abi::ExternAbi;
1212
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
13+
use rustc_errors::FatalErrorMarker;
1314
use rustc_hir::def::Namespace;
1415
use rustc_hir::def_id::DefId;
1516
use 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

0 commit comments

Comments
 (0)