1
Fork 0

Reduce the amount of explicit FatalError.raise()

Instead use dcx.abort_if_error() or guar.raise_fatal() instead. These
guarantee that an error actually happened previously and thus we don't
silently abort.
This commit is contained in:
bjorn3 2024-12-20 14:08:24 +00:00
parent 8a1f8039a7
commit 701e2f708b
6 changed files with 22 additions and 41 deletions

View file

@ -1,8 +1,6 @@
use std::fmt;
use rustc_errors::{
Diag, E0275, EmissionGuarantee, ErrorGuaranteed, FatalError, struct_span_code_err,
};
use rustc_errors::{Diag, E0275, EmissionGuarantee, ErrorGuaranteed, struct_span_code_err};
use rustc_hir::def::Namespace;
use rustc_hir::def_id::LOCAL_CRATE;
use rustc_infer::traits::{Obligation, PredicateObligation};
@ -52,8 +50,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
) -> ! {
let mut err = self.build_overflow_error(cause, span, suggest_increasing_limit);
mutate(&mut err);
err.emit();
FatalError.raise();
err.emit().raise_fatal();
}
pub fn build_overflow_error(