Skip to content

Commit

Permalink
Unrolled build for rust-lang#120782
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rust-timer authored Feb 8, 2024
2 parents c29082f + 7dc182d commit a171ec0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_errors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,7 @@ impl DiagCtxt {
self.struct_span_warn(span, msg).emit()
}

#[track_caller]
pub fn span_bug(&self, span: impl Into<MultiSpan>, msg: impl Into<DiagnosticMessage>) -> ! {
self.struct_span_bug(span, msg).emit()
}
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_mir_transform/src/abort_unwinding_calls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a171ec0

Please sign in to comment.