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.
This commit is contained in:
parent
65b323b168
commit
f0a3684c1e
1 changed files with 5 additions and 13 deletions
|
@ -1168,7 +1168,8 @@ impl DiagCtxt {
|
||||||
let mut inner = self.inner.borrow_mut();
|
let mut inner = self.inner.borrow_mut();
|
||||||
|
|
||||||
if loud && lint_level.is_error() {
|
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)
|
inner.emitter.emit_unused_externs(lint_level, unused_externs)
|
||||||
|
@ -1353,10 +1354,11 @@ impl DiagCtxtInner {
|
||||||
}
|
}
|
||||||
if diagnostic.is_error() {
|
if diagnostic.is_error() {
|
||||||
if diagnostic.is_lint {
|
if diagnostic.is_lint {
|
||||||
self.bump_lint_err_count();
|
self.lint_err_count += 1;
|
||||||
} else {
|
} else {
|
||||||
self.bump_err_count();
|
self.err_count += 1;
|
||||||
}
|
}
|
||||||
|
self.panic_if_treat_err_as_bug();
|
||||||
|
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
{
|
{
|
||||||
|
@ -1447,16 +1449,6 @@ impl DiagCtxtInner {
|
||||||
panic::panic_any(DelayedBugPanic);
|
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) {
|
fn panic_if_treat_err_as_bug(&self) {
|
||||||
if self.treat_err_as_bug() {
|
if self.treat_err_as_bug() {
|
||||||
match (
|
match (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue