From 19664e276aba21a42cad5351a2c91995d1ce5d52 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 13 Mar 2021 17:36:07 +0100 Subject: Use chalk_ir::AssocTypeId --- crates/hir_ty/src/lower.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'crates/hir_ty/src/lower.rs') diff --git a/crates/hir_ty/src/lower.rs b/crates/hir_ty/src/lower.rs index a35d7266d..a5ab1ff70 100644 --- a/crates/hir_ty/src/lower.rs +++ b/crates/hir_ty/src/lower.rs @@ -27,6 +27,7 @@ use stdx::impl_from; use crate::{ db::HirDatabase, + to_assoc_type_id, traits::chalk::{Interner, ToChalk}, utils::{ all_super_trait_refs, associated_type_by_name_including_super_traits, generics, @@ -358,7 +359,7 @@ impl Ty { Some((super_trait_ref, associated_ty)) => { // FIXME handle type parameters on the segment TyKind::Alias(AliasTy::Projection(ProjectionTy { - associated_ty, + associated_ty: to_assoc_type_id(associated_ty), parameters: super_trait_ref.substs, })) .intern(&Interner) @@ -487,7 +488,7 @@ impl Ty { // FIXME handle type parameters on the segment return Some( TyKind::Alias(AliasTy::Projection(ProjectionTy { - associated_ty, + associated_ty: to_assoc_type_id(associated_ty), parameters: substs, })) .intern(&Interner), @@ -753,7 +754,10 @@ fn assoc_type_bindings_from_type_bound<'a>( None => return SmallVec::<[GenericPredicate; 1]>::new(), Some(t) => t, }; - let projection_ty = ProjectionTy { associated_ty, parameters: super_trait_ref.substs }; + let projection_ty = ProjectionTy { + associated_ty: to_assoc_type_id(associated_ty), + parameters: super_trait_ref.substs, + }; let mut preds = SmallVec::with_capacity( binding.type_ref.as_ref().map_or(0, |_| 1) + binding.bounds.len(), ); -- cgit v1.2.3