Skip to content

Commit 6b22a42

Browse files
committed
Include lint errors in error count for -Ztreat-err-as-bug
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.
1 parent 207c80f commit 6b22a42

File tree

1 file changed

+4
-1
lines changed
  • compiler/rustc_errors/src

1 file changed

+4
-1
lines changed

compiler/rustc_errors/src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,10 @@ impl HandlerInner {
12051205

12061206
fn panic_if_treat_err_as_bug(&self) {
12071207
if self.treat_err_as_bug() {
1208-
match (self.err_count(), self.flags.treat_err_as_bug.map(|c| c.get()).unwrap_or(0)) {
1208+
match (
1209+
self.err_count() + self.lint_err_count,
1210+
self.flags.treat_err_as_bug.map(|c| c.get()).unwrap_or(0),
1211+
) {
12091212
(1, 1) => panic!("aborting due to `-Z treat-err-as-bug=1`"),
12101213
(0, _) | (1, _) => {}
12111214
(count, as_bug) => panic!(

0 commit comments

Comments
 (0)