From 8996b1a2353539cb9c264d0effbde80567de6586 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Fri, 19 Mar 2021 02:07:15 +0100 Subject: Replace Projection variant in GenericPredicate with AliasEq --- crates/hir_ty/src/autoderef.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'crates/hir_ty/src/autoderef.rs') diff --git a/crates/hir_ty/src/autoderef.rs b/crates/hir_ty/src/autoderef.rs index ad4e6f23b..33b966026 100644 --- a/crates/hir_ty/src/autoderef.rs +++ b/crates/hir_ty/src/autoderef.rs @@ -15,7 +15,8 @@ use crate::{ to_assoc_type_id, to_chalk_trait_id, traits::{InEnvironment, Solution}, utils::generics, - BoundVar, Canonical, DebruijnIndex, Interner, Obligation, Substitution, TraitRef, Ty, TyKind, + AliasEq, AliasTy, BoundVar, Canonical, DebruijnIndex, Interner, Obligation, ProjectionTy, + Substitution, TraitRef, Ty, TyKind, }; const AUTODEREF_RECURSION_LIMIT: usize = 10; @@ -82,16 +83,16 @@ fn deref_by_trait( } // Now do the assoc type projection - let projection = super::traits::ProjectionPredicate { - ty: TyKind::BoundVar(BoundVar::new(DebruijnIndex::INNERMOST, ty.value.kinds.len())) - .intern(&Interner), - projection_ty: super::ProjectionTy { + let projection = AliasEq { + alias: AliasTy::Projection(ProjectionTy { associated_ty_id: to_assoc_type_id(target), substitution: parameters, - }, + }), + ty: TyKind::BoundVar(BoundVar::new(DebruijnIndex::INNERMOST, ty.value.kinds.len())) + .intern(&Interner), }; - let obligation = super::Obligation::Projection(projection); + let obligation = super::Obligation::AliasEq(projection); let in_env = InEnvironment { value: obligation, environment: ty.environment }; -- cgit v1.2.3