Skip to content

Commit f0a3684

Browse files
committed
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.
1 parent 65b323b commit f0a3684

File tree

1 file changed

+5
-13
lines changed
  • compiler/rustc_errors/src

1 file changed

+5
-13
lines changed

compiler/rustc_errors/src/lib.rs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,8 @@ impl DiagCtxt {
11681168
let mut inner = self.inner.borrow_mut();
11691169

11701170
if loud && lint_level.is_error() {
1171-
inner.bump_err_count();
1171+
inner.err_count += 1;
1172+
inner.panic_if_treat_err_as_bug();
11721173
}
11731174

11741175
inner.emitter.emit_unused_externs(lint_level, unused_externs)
@@ -1353,10 +1354,11 @@ impl DiagCtxtInner {
13531354
}
13541355
if diagnostic.is_error() {
13551356
if diagnostic.is_lint {
1356-
self.bump_lint_err_count();
1357+
self.lint_err_count += 1;
13571358
} else {
1358-
self.bump_err_count();
1359+
self.err_count += 1;
13591360
}
1361+
self.panic_if_treat_err_as_bug();
13601362

13611363
#[allow(deprecated)]
13621364
{
@@ -1447,16 +1449,6 @@ impl DiagCtxtInner {
14471449
panic::panic_any(DelayedBugPanic);
14481450
}
14491451

1450-
fn bump_lint_err_count(&mut self) {
1451-
self.lint_err_count += 1;
1452-
self.panic_if_treat_err_as_bug();
1453-
}
1454-
1455-
fn bump_err_count(&mut self) {
1456-
self.err_count += 1;
1457-
self.panic_if_treat_err_as_bug();
1458-
}
1459-
14601452
fn panic_if_treat_err_as_bug(&self) {
14611453
if self.treat_err_as_bug() {
14621454
match (

0 commit comments

Comments
 (0)