1
Fork 0

Use DeepRejectCtxt to quickly reject ParamEnv candidates

This commit is contained in:
Bryanskiy 2024-08-04 19:52:15 +03:00
parent 717aec0f8e
commit c51953f4d8
16 changed files with 287 additions and 167 deletions

View file

@ -90,7 +90,8 @@ impl<'tcx> InherentCollect<'tcx> {
}
}
if let Some(simp) = simplify_type(self.tcx, self_ty, TreatParams::AsCandidateKey) {
if let Some(simp) = simplify_type(self.tcx, self_ty, TreatParams::InstantiateWithInfer)
{
self.impls_map.incoherent_impls.entry(simp).or_default().push(impl_def_id);
} else {
bug!("unexpected self type: {:?}", self_ty);
@ -129,7 +130,7 @@ impl<'tcx> InherentCollect<'tcx> {
}
}
if let Some(simp) = simplify_type(self.tcx, ty, TreatParams::AsCandidateKey) {
if let Some(simp) = simplify_type(self.tcx, ty, TreatParams::InstantiateWithInfer) {
self.impls_map.incoherent_impls.entry(simp).or_default().push(impl_def_id);
} else {
bug!("unexpected primitive type: {:?}", ty);