Fix mir pass ICE in the presence of other errors

This commit is contained in:
Oli Scherer 2024-02-08 14:49:27 +00:00
parent 6af2d3cc90
commit 7dc182d5d4

View File

@ -41,6 +41,7 @@ fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
ty::Closure(..) => Abi::RustCall, ty::Closure(..) => Abi::RustCall,
ty::CoroutineClosure(..) => Abi::RustCall, ty::CoroutineClosure(..) => Abi::RustCall,
ty::Coroutine(..) => Abi::Rust, ty::Coroutine(..) => Abi::Rust,
ty::Error(_) => return,
_ => span_bug!(body.span, "unexpected body ty: {:?}", body_ty), _ => span_bug!(body.span, "unexpected body ty: {:?}", body_ty),
}; };
let body_can_unwind = layout::fn_can_unwind(tcx, Some(def_id), body_abi); let body_can_unwind = layout::fn_can_unwind(tcx, Some(def_id), body_abi);