1
Fork 0

Avoid manually producing FatalError in a couple of places

This commit is contained in:
bjorn3 2025-02-05 15:09:15 +00:00
parent 9a833de62a
commit 8a0adec05b
2 changed files with 3 additions and 3 deletions

View file

@ -1024,7 +1024,7 @@ pub fn describe_flag_categories(early_dcx: &EarlyDiagCtxt, matches: &Matches) ->
let wall = matches.opt_strs("W");
if wall.iter().any(|x| *x == "all") {
print_wall_help();
rustc_errors::FatalError.raise();
return true;
}
// Don't handle -W help here, because we might first load additional lints.

View file

@ -1048,8 +1048,8 @@ impl<'a> DiagCtxtHandle<'a> {
/// 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();
if let Some(guar) = self.has_errors() {
guar.raise_fatal();
}
}