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

@@ -143,6 +143,16 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate<
None
}
}
ty::PredicateKind::Clause(ty::ClauseKind::WellFormed(arg)) => {
let arg = self.shallow_resolve_term(arg);
if arg.is_trivially_wf(self.tcx) {
Some(Certainty::Yes)
} else if arg.is_infer() {
Some(Certainty::AMBIGUOUS)
} else {
None
}
}
_ => None,
}
}