1
Fork 0

Exclude inherent projections from some alias ty matches

This commit is contained in:
León Orell Valerian Liehr 2023-05-17 19:47:23 +02:00
parent c2ccc855e7
commit 434f08884e
No known key found for this signature in database
GPG key ID: D17A07215F68E713
6 changed files with 29 additions and 5 deletions

View file

@ -506,10 +506,12 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
| ty::Param(_)
| ty::Placeholder(..)
| ty::Infer(ty::IntVar(_) | ty::FloatVar(_))
| ty::Alias(ty::Inherent, _)
| ty::Error(_) => return,
ty::Infer(ty::TyVar(_) | ty::FreshTy(_) | ty::FreshIntTy(_) | ty::FreshFloatTy(_))
| ty::Bound(..) => bug!("unexpected self type for `{goal:?}`"),
ty::Alias(_, alias_ty) => alias_ty,
// Excluding IATs here as they don't have meaningful item bounds.
ty::Alias(ty::Projection | ty::Opaque, alias_ty) => alias_ty,
};
for assumption in self.tcx().item_bounds(alias_ty.def_id).subst(self.tcx(), alias_ty.substs)