1
Fork 0

Rollup merge of #118933 - nnethercote:cleanup-errors-even-more, r=compiler-errors

Cleanup errors handlers even more

A sequel to #118587.

r? `@compiler-errors`
This commit is contained in:
Jubilee 2023-12-14 16:07:48 -08:00 committed by GitHub
commit 9e872b7cd8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 117 additions and 113 deletions

View file

@ -277,8 +277,8 @@ impl<'mir, 'tcx> Checker<'mir, 'tcx> {
// "secondary" errors if they occurred.
let secondary_errors = mem::take(&mut self.secondary_errors);
if self.error_emitted.is_none() {
for mut error in secondary_errors {
self.tcx.sess.diagnostic().emit_diagnostic(&mut error);
for error in secondary_errors {
self.tcx.sess.diagnostic().emit_diagnostic(error);
}
} else {
assert!(self.tcx.sess.has_errors().is_some());