Use is_trivially_wf for ProvePredicate fast path

This commit is contained in:
Michael Goulet
2025-07-02 00:30:10 +00:00
parent ae0bef778a
commit d3c0ef0c9f

View File

@@ -21,19 +21,9 @@ impl<'tcx> super::QueryTypeOp<'tcx> for ProvePredicate<'tcx> {
if let ty::PredicateKind::Clause(ty::ClauseKind::WellFormed(term)) =
key.value.predicate.kind().skip_binder()
&& term.is_trivially_wf(tcx)
{
match term.as_type()?.kind() {
ty::Param(_)
| ty::Bool
| ty::Char
| ty::Int(_)
| ty::Float(_)
| ty::Str
| ty::Uint(_) => {
return Some(());
}
_ => {}
}
return Some(());
}
None