Skip to content

Commit 1db56fb

Browse files
authored
Rollup merge of rust-lang#120782 - oli-obk:track_errors8, r=WaffleLapkin
Fix mir pass ICE in the presence of other errors fixes rust-lang#120779 it is impossible to add a ui test for this, because it only reproduces in build-fail, but a test that also has errors in check-fail mode can't be made build-fail 🙃 I would have to add a run-make test or sth, which is overkill for such a tiny thing imo.
2 parents 3e523f6 + 7dc182d commit 1db56fb

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

compiler/rustc_errors/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,7 @@ impl DiagCtxt {
847847
self.struct_span_warn(span, msg).emit()
848848
}
849849

850+
#[track_caller]
850851
pub fn span_bug(&self, span: impl Into<MultiSpan>, msg: impl Into<DiagnosticMessage>) -> ! {
851852
self.struct_span_bug(span, msg).emit()
852853
}

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)