Skip to content

Commit

Permalink
Include lint errors in error count for -Ztreat-err-as-bug
Browse files Browse the repository at this point in the history
This was a regression from rust-lang#87337;
the `panic_if_treat_err_as_bug` function only checked the number of hard
errors, not the number of lint errors.
  • Loading branch information
jyn514 committed Dec 1, 2021
1 parent 207c80f commit 6b22a42
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compiler/rustc_errors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,10 @@ impl HandlerInner {

fn panic_if_treat_err_as_bug(&self) {
if self.treat_err_as_bug() {
match (self.err_count(), self.flags.treat_err_as_bug.map(|c| c.get()).unwrap_or(0)) {
match (
self.err_count() + self.lint_err_count,
self.flags.treat_err_as_bug.map(|c| c.get()).unwrap_or(0),
) {
(1, 1) => panic!("aborting due to `-Z treat-err-as-bug=1`"),
(0, _) | (1, _) => {}
(count, as_bug) => panic!(
Expand Down

0 comments on commit 6b22a42

Please sign in to comment.