Skip to content

Commit 7dc182d

Browse files
committed
Fix mir pass ICE in the presence of other errors
1 parent 6af2d3c commit 7dc182d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/rustc_mir_transform/src/abort_unwinding_calls.rs

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ impl<'tcx> MirPass<'tcx> for AbortUnwindingCalls {
4141
ty::Closure(..) => Abi::RustCall,
4242
ty::CoroutineClosure(..) => Abi::RustCall,
4343
ty::Coroutine(..) => Abi::Rust,
44+
ty::Error(_) => return,
4445
_ => span_bug!(body.span, "unexpected body ty: {:?}", body_ty),
4546
};
4647
let body_can_unwind = layout::fn_can_unwind(tcx, Some(def_id), body_abi);

0 commit comments

Comments
 (0)