aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/autoderef.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-03-19 11:12:54 +0000
committerGitHub <[email protected]>2021-03-19 11:12:54 +0000
commit98d29d4f538899a8bd8caac7f4d2459438a1ae9a (patch)
tree49fc49a406fed5f239a5a8a7cee4cf52fb56e568 /crates/hir_ty/src/autoderef.rs
parent26fdd17cc6fc79b476977c2a40a90de7095e4b45 (diff)
parent8996b1a2353539cb9c264d0effbde80567de6586 (diff)
Merge #8101
8101: Replace Projection variant in GenericPredicate with AliasEq r=flodiebold a=Veykril Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/autoderef.rs')
-rw-r--r--crates/hir_ty/src/autoderef.rs15
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
21const AUTODEREF_RECURSION_LIMIT: usize = 10; 22const 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