diff options
Diffstat (limited to 'crates/hir_ty/src/lower.rs')
-rw-r--r-- | crates/hir_ty/src/lower.rs | 10 |
1 files changed, 7 insertions, 3 deletions
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; | |||
27 | 27 | ||
28 | use crate::{ | 28 | use crate::{ |
29 | db::HirDatabase, | 29 | db::HirDatabase, |
30 | to_assoc_type_id, | ||
30 | traits::chalk::{Interner, ToChalk}, | 31 | traits::chalk::{Interner, ToChalk}, |
31 | utils::{ | 32 | utils::{ |
32 | all_super_trait_refs, associated_type_by_name_including_super_traits, generics, | 33 | all_super_trait_refs, associated_type_by_name_including_super_traits, generics, |
@@ -358,7 +359,7 @@ impl Ty { | |||
358 | Some((super_trait_ref, associated_ty)) => { | 359 | Some((super_trait_ref, associated_ty)) => { |
359 | // FIXME handle type parameters on the segment | 360 | // FIXME handle type parameters on the segment |
360 | TyKind::Alias(AliasTy::Projection(ProjectionTy { | 361 | TyKind::Alias(AliasTy::Projection(ProjectionTy { |
361 | associated_ty, | 362 | associated_ty: to_assoc_type_id(associated_ty), |
362 | parameters: super_trait_ref.substs, | 363 | parameters: super_trait_ref.substs, |
363 | })) | 364 | })) |
364 | .intern(&Interner) | 365 | .intern(&Interner) |
@@ -487,7 +488,7 @@ impl Ty { | |||
487 | // FIXME handle type parameters on the segment | 488 | // FIXME handle type parameters on the segment |
488 | return Some( | 489 | return Some( |
489 | TyKind::Alias(AliasTy::Projection(ProjectionTy { | 490 | TyKind::Alias(AliasTy::Projection(ProjectionTy { |
490 | associated_ty, | 491 | associated_ty: to_assoc_type_id(associated_ty), |
491 | parameters: substs, | 492 | parameters: substs, |
492 | })) | 493 | })) |
493 | .intern(&Interner), | 494 | .intern(&Interner), |
@@ -753,7 +754,10 @@ fn assoc_type_bindings_from_type_bound<'a>( | |||
753 | None => return SmallVec::<[GenericPredicate; 1]>::new(), | 754 | None => return SmallVec::<[GenericPredicate; 1]>::new(), |
754 | Some(t) => t, | 755 | Some(t) => t, |
755 | }; | 756 | }; |
756 | let projection_ty = ProjectionTy { associated_ty, parameters: super_trait_ref.substs }; | 757 | let projection_ty = ProjectionTy { |
758 | associated_ty: to_assoc_type_id(associated_ty), | ||
759 | parameters: super_trait_ref.substs, | ||
760 | }; | ||
757 | let mut preds = SmallVec::with_capacity( | 761 | let mut preds = SmallVec::with_capacity( |
758 | binding.type_ref.as_ref().map_or(0, |_| 1) + binding.bounds.len(), | 762 | binding.type_ref.as_ref().map_or(0, |_| 1) + binding.bounds.len(), |
759 | ); | 763 | ); |