Apply fast path to old solver too

This commit is contained in:
Michael Goulet
2025-06-09 17:46:00 +00:00
parent b8ef88517d
commit 92e60e98af
2 changed files with 10 additions and 2 deletions

View File

@@ -660,6 +660,10 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
}
ty::PredicateKind::Clause(ty::ClauseKind::WellFormed(term)) => {
if term.is_trivially_wf(self.tcx()) {
return Ok(EvaluatedToOk);
}
// So, there is a bit going on here. First, `WellFormed` predicates
// are coinductive, like trait predicates with auto traits.
// This means that we need to detect if we have recursively