1
Fork 0

Replace unnecessary abort_if_errors.

Replace `abort_if_errors` calls that are certain to abort -- because
we emit an error immediately beforehand -- with `FatalErro.raise()`.
This commit is contained in:
Nicholas Nethercote 2024-02-19 10:23:58 +11:00
parent 44006444c8
commit 4da67fff61
6 changed files with 13 additions and 23 deletions

View file

@ -876,6 +876,10 @@ impl DiagCtxt {
}
}
/// This excludes delayed bugs and stashed errors. Used for early aborts
/// after errors occurred -- e.g. because continuing in the face of errors is
/// likely to lead to bad results, such as spurious/uninteresting
/// additional errors -- when returning an error `Result` is difficult.
pub fn abort_if_errors(&self) {
if self.has_errors().is_some() {
FatalError.raise();