From 7dc182d5d405a08ecdb4d652e10c6b6f183d61e7 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Thu, 8 Feb 2024 14:49:27 +0000 Subject: Fix mir pass ICE in the presence of other errors --- compiler/rustc_mir_transform/src/abort_unwinding_calls.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_mir_transform/src/abort_unwinding_calls.rs b/compiler/rustc_mir_transform/src/abort_unwinding_calls.rs index 451d3be255f..ba70a4453d6 100644 --- a/compiler/rustc_mir_transform/src/abort_unwinding_calls.rs +++ b/compiler/rustc_mir_transform/src/abort_unwinding_calls.rs @@ -41,6 +41,7 @@ impl<'tcx> MirPass<'tcx> for AbortUnwindingCalls { ty::Closure(..) => Abi::RustCall, ty::CoroutineClosure(..) => Abi::RustCall, ty::Coroutine(..) => Abi::Rust, + ty::Error(_) => return, _ => span_bug!(body.span, "unexpected body ty: {:?}", body_ty), }; let body_can_unwind = layout::fn_can_unwind(tcx, Some(def_id), body_abi); -- cgit 1.4.1-3-g733a5