Simplify lint error counting.
Of the error levels satisfying `is_error`, `Level::Error` is the only one that can be a lint, so there's no need to check for it. (And even if it wasn't, it would make more sense to include non-`Error`-but-`is_error` lints under `lint_err_count` than under `err_count`.)
This commit is contained in:
parent
56c3265c7b
commit
dd61eba3c3
1 changed files with 4 additions and 4 deletions
|
@ -672,7 +672,7 @@ impl DiagCtxt {
|
||||||
let key = (span.with_parent(None), key);
|
let key = (span.with_parent(None), key);
|
||||||
|
|
||||||
if diag.is_error() {
|
if diag.is_error() {
|
||||||
if diag.level == Error && diag.is_lint {
|
if diag.is_lint {
|
||||||
inner.lint_err_count += 1;
|
inner.lint_err_count += 1;
|
||||||
} else {
|
} else {
|
||||||
inner.err_count += 1;
|
inner.err_count += 1;
|
||||||
|
@ -691,7 +691,7 @@ impl DiagCtxt {
|
||||||
let key = (span.with_parent(None), key);
|
let key = (span.with_parent(None), key);
|
||||||
let diag = inner.stashed_diagnostics.remove(&key)?;
|
let diag = inner.stashed_diagnostics.remove(&key)?;
|
||||||
if diag.is_error() {
|
if diag.is_error() {
|
||||||
if diag.level == Error && diag.is_lint {
|
if diag.is_lint {
|
||||||
inner.lint_err_count -= 1;
|
inner.lint_err_count -= 1;
|
||||||
} else {
|
} else {
|
||||||
inner.err_count -= 1;
|
inner.err_count -= 1;
|
||||||
|
@ -1235,7 +1235,7 @@ impl DiagCtxtInner {
|
||||||
for diag in diags {
|
for diag in diags {
|
||||||
// Decrement the count tracking the stash; emitting will increment it.
|
// Decrement the count tracking the stash; emitting will increment it.
|
||||||
if diag.is_error() {
|
if diag.is_error() {
|
||||||
if diag.level == Error && diag.is_lint {
|
if diag.is_lint {
|
||||||
self.lint_err_count -= 1;
|
self.lint_err_count -= 1;
|
||||||
} else {
|
} else {
|
||||||
self.err_count -= 1;
|
self.err_count -= 1;
|
||||||
|
@ -1352,7 +1352,7 @@ impl DiagCtxtInner {
|
||||||
self.has_printed = true;
|
self.has_printed = true;
|
||||||
}
|
}
|
||||||
if diagnostic.is_error() {
|
if diagnostic.is_error() {
|
||||||
if diagnostic.level == Error && diagnostic.is_lint {
|
if diagnostic.is_lint {
|
||||||
self.bump_lint_err_count();
|
self.bump_lint_err_count();
|
||||||
} else {
|
} else {
|
||||||
self.bump_err_count();
|
self.bump_err_count();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue