diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-01-10 14:27:02 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-01-11 16:54:22 +1100 |
| commit | f0a3684c1e792b6c16e32dc154de34328beef619 (patch) | |
| tree | ffd50d66ebe1c71b2fc04c80fef384940d797398 /compiler/rustc_errors/src | |
| parent | 65b323b168daa6c723a8a5b4ddf939f3b12e0329 (diff) | |
| download | rust-f0a3684c1e792b6c16e32dc154de34328beef619.tar.gz rust-f0a3684c1e792b6c16e32dc154de34328beef619.zip | |
Inline and remove `DiagCtxtInner::bump_{lint_err,err}_count`.
They have one and two call sites respectively, and they just make the code harder to read.
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 8fb539fc358..b2b74c7195a 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -1168,7 +1168,8 @@ impl DiagCtxt { let mut inner = self.inner.borrow_mut(); if loud && lint_level.is_error() { - inner.bump_err_count(); + inner.err_count += 1; + inner.panic_if_treat_err_as_bug(); } inner.emitter.emit_unused_externs(lint_level, unused_externs) @@ -1353,10 +1354,11 @@ impl DiagCtxtInner { } if diagnostic.is_error() { if diagnostic.is_lint { - self.bump_lint_err_count(); + self.lint_err_count += 1; } else { - self.bump_err_count(); + self.err_count += 1; } + self.panic_if_treat_err_as_bug(); #[allow(deprecated)] { @@ -1447,16 +1449,6 @@ impl DiagCtxtInner { panic::panic_any(DelayedBugPanic); } - fn bump_lint_err_count(&mut self) { - self.lint_err_count += 1; - self.panic_if_treat_err_as_bug(); - } - - fn bump_err_count(&mut self) { - self.err_count += 1; - self.panic_if_treat_err_as_bug(); - } - fn panic_if_treat_err_as_bug(&self) { if self.treat_err_as_bug() { match ( |
