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

@ -1645,7 +1645,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
let tcx = self.infcx.tcx;
let (def_id, substs) = match *placeholder_trait_predicate.trait_ref.self_ty().kind() {
ty::Alias(_, ty::AliasTy { def_id, substs, .. }) => (def_id, substs),
ty::Alias(ty::Projection | ty::Opaque, ty::AliasTy { def_id, substs, .. }) => {
(def_id, substs)
}
_ => {
span_bug!(
obligation.cause.span,