propagate tainted_by_errors in MirBorrowckCtxt::emit_errors

This commit is contained in:
Folkert de Vries
2024-09-04 12:29:44 +02:00
parent 842d6fc32e
commit f7679d0507
7 changed files with 35 additions and 8 deletions

View File

@@ -2522,7 +2522,7 @@ mod diags {
}
pub(crate) fn emit_errors(&mut self) -> Option<ErrorGuaranteed> {
let mut res = None;
let mut res = self.infcx.tainted_by_errors();
// Buffer any move errors that we collected and de-duplicated.
for (_, (_, diag)) in std::mem::take(&mut self.diags.buffered_move_errors) {