Auto merge of #142223 - compiler-errors:perf-wf, r=lcnr

Fast path for WF goals in new solver

Hopefully self-explanatory.
This commit is contained in:
bors
2025-06-27 03:57:45 +00:00
7 changed files with 94 additions and 3 deletions

View File

@@ -662,6 +662,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