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

@ -6,6 +6,7 @@ use crate::errors::{
};
use crate::Session;
use rustc_ast::{self as ast, attr};
use rustc_errors::FatalError;
use rustc_span::symbol::sym;
use rustc_span::{Span, Symbol};
use std::path::Path;
@ -115,7 +116,7 @@ pub fn validate_crate_name(sess: &Session, s: Symbol, sp: Option<Span>) {
}
if err_count > 0 {
sess.dcx().abort_if_errors();
FatalError.raise();
}
}