diff options
author | Lukas Wirth <[email protected]> | 2021-03-19 01:07:15 +0000 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2021-03-19 11:12:18 +0000 |
commit | 8996b1a2353539cb9c264d0effbde80567de6586 (patch) | |
tree | 4702a4384ee97782670c20e597c40e7da61b4fc2 /crates/hir_ty/src/autoderef.rs | |
parent | 86878443b1789cac0e48177f5f2b95ad0d6e912c (diff) |
Replace Projection variant in GenericPredicate with AliasEq
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 | ||