Skip to content

Commit 8a0adec

Browse files
committed
Avoid manually producing FatalError in a couple of places
1 parent 9a833de commit 8a0adec

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/rustc_driver_impl/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ pub fn describe_flag_categories(early_dcx: &EarlyDiagCtxt, matches: &Matches) ->
10241024
let wall = matches.opt_strs("W");
10251025
if wall.iter().any(|x| *x == "all") {
10261026
print_wall_help();
1027-
rustc_errors::FatalError.raise();
1027+
return true;
10281028
}
10291029

10301030
// Don't handle -W help here, because we might first load additional lints.

compiler/rustc_errors/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1048,8 +1048,8 @@ impl<'a> DiagCtxtHandle<'a> {
10481048
/// bad results, such as spurious/uninteresting additional errors -- when
10491049
/// returning an error `Result` is difficult.
10501050
pub fn abort_if_errors(&self) {
1051-
if self.has_errors().is_some() {
1052-
FatalError.raise();
1051+
if let Some(guar) = self.has_errors() {
1052+
guar.raise_fatal();
10531053
}
10541054
}
10551055

0 commit comments

Comments
 (0)