try fast path for wf type ops

This commit is contained in:
Ali MJ Al-Nasrawy 2023-11-09 10:12:56 +00:00 committed by lcnr
parent aac2f84794
commit 66090ef7ba

View File

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