Only bump error count when we are sure that the diagnostic is not a repetition.
This ensures that if we emit the same diagnostic twice, the error count will match the real number of errors shown to the user. Fixes #42106
This commit is contained in:
parent
687d3d15ba
commit
063607eecb
8 changed files with 14 additions and 20 deletions
|
|
@ -588,6 +588,9 @@ impl Handler {
|
|||
// one:
|
||||
if self.emitted_diagnostics.borrow_mut().insert(diagnostic_hash) {
|
||||
self.emitter.borrow_mut().emit(db);
|
||||
if db.is_error() {
|
||||
self.bump_err_count();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue