1
Fork 0

taint fcx on selection errors during unsizing

This commit is contained in:
Lukas Markeffsky 2025-01-02 18:31:40 +01:00
parent bf6f8a4d32
commit 93bb639ad6
5 changed files with 119 additions and 14 deletions

View file

@ -666,7 +666,12 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
// Dyn-compatibility violations or miscellaneous.
Err(err) => {
self.err_ctxt().report_selection_error(obligation.clone(), &obligation, &err);
let guar = self.err_ctxt().report_selection_error(
obligation.clone(),
&obligation,
&err,
);
self.fcx.set_tainted_by_errors(guar);
// Treat this like an obligation and follow through
// with the unsizing - the lack of a coercion should
// be silent, as it causes a type mismatch later.