diff options
Diffstat (limited to 'crates/hir_ty/src/autoderef.rs')
-rw-r--r-- | crates/hir_ty/src/autoderef.rs | 15 |
1 files changed, 8 insertions, 7 deletions
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::{ | |||
15 | to_assoc_type_id, to_chalk_trait_id, | 15 | to_assoc_type_id, to_chalk_trait_id, |
16 | traits::{InEnvironment, Solution}, | 16 | traits::{InEnvironment, Solution}, |
17 | utils::generics, | 17 | utils::generics, |
18 | BoundVar, Canonical, DebruijnIndex, Interner, Obligation, Substitution, TraitRef, Ty, TyKind, | 18 | AliasEq, AliasTy, BoundVar, Canonical, DebruijnIndex, Interner, Obligation, ProjectionTy, |
19 | Substitution, TraitRef, Ty, TyKind, | ||
19 | }; | 20 | }; |
20 | 21 | ||
21 | const AUTODEREF_RECURSION_LIMIT: usize = 10; | 22 | const AUTODEREF_RECURSION_LIMIT: usize = 10; |
@@ -82,16 +83,16 @@ fn deref_by_trait( | |||
82 | } | 83 | } |
83 | 84 | ||
84 | // Now do the assoc type projection | 85 | // Now do the assoc type projection |
85 | let projection = super::traits::ProjectionPredicate { | 86 | let projection = AliasEq { |
86 | ty: TyKind::BoundVar(BoundVar::new(DebruijnIndex::INNERMOST, ty.value.kinds.len())) | 87 | alias: AliasTy::Projection(ProjectionTy { |
87 | .intern(&Interner), | ||
88 | projection_ty: super::ProjectionTy { | ||
89 | associated_ty_id: to_assoc_type_id(target), | 88 | associated_ty_id: to_assoc_type_id(target), |
90 | substitution: parameters, | 89 | substitution: parameters, |
91 | }, | 90 | }), |
91 | ty: TyKind::BoundVar(BoundVar::new(DebruijnIndex::INNERMOST, ty.value.kinds.len())) | ||
92 | .intern(&Interner), | ||
92 | }; | 93 | }; |
93 | 94 | ||
94 | let obligation = super::Obligation::Projection(projection); | 95 | let obligation = super::Obligation::AliasEq(projection); |
95 | 96 | ||
96 | let in_env = InEnvironment { value: obligation, environment: ty.environment }; | 97 | let in_env = InEnvironment { value: obligation, environment: ty.environment }; |
97 | 98 | ||