Restore error messaging

This commit is contained in:
Michael Goulet 2024-03-26 13:35:13 -04:00
parent 9d4f1d8b7e
commit 93c6c0445d
4 changed files with 17 additions and 8 deletions

View file

@ -1465,6 +1465,17 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
ocx.register_obligation(obligation);
} else {
result = ProbeResult::NoMatch;
if let Ok(Some(candidate)) = self.select_trait_candidate(trait_ref) {
for nested_obligation in candidate.nested_obligations() {
if !self.infcx.predicate_may_hold(&nested_obligation) {
possibly_unsatisfied_predicates.push((
self.resolve_vars_if_possible(nested_obligation.predicate),
Some(self.resolve_vars_if_possible(obligation.predicate)),
Some(nested_obligation.cause),
));
}
}
}
}
trait_predicate = Some(ty::Binder::dummy(trait_ref).to_predicate(self.tcx));