diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-12-01 20:57:47 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-01 20:57:47 +0100 |
| commit | 4a6e8a9c93146e0e36c2d2bb8a3941de405ea078 (patch) | |
| tree | 151a1a20d38015efb005ad613842d6ccab669c8c /compiler/rustc_errors | |
| parent | 5fb1886629a083751f3cf979f97d0c09efaaf647 (diff) | |
| parent | 9de8a4a6faa320f2b972fbd4761cf2a85ef20277 (diff) | |
| download | rust-4a6e8a9c93146e0e36c2d2bb8a3941de405ea078.tar.gz rust-4a6e8a9c93146e0e36c2d2bb8a3941de405ea078.zip | |
Rollup merge of #91425 - jyn514:treat-lint-err-as-bug, r=oli-obk
Include lint errors in error count for `-Ztreat-err-as-bug` This was a regression from https://github.com/rust-lang/rust/pull/87337; the `panic_if_treat_err_as_bug` function only checked the number of hard errors, not the number of lint errors. r? `@oli-obk`
Diffstat (limited to 'compiler/rustc_errors')
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index bb3d3a415e7..82a02c3e543 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -1013,7 +1013,9 @@ impl HandlerInner { } fn treat_err_as_bug(&self) -> bool { - self.flags.treat_err_as_bug.map_or(false, |c| self.err_count() >= c.get()) + self.flags + .treat_err_as_bug + .map_or(false, |c| self.err_count() + self.lint_err_count >= c.get()) } fn print_error_count(&mut self, registry: &Registry) { @@ -1205,7 +1207,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!( |
