aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/lib.rs')
-rw-r--r--crates/hir_ty/src/lib.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/hir_ty/src/lib.rs b/crates/hir_ty/src/lib.rs
index d6ff968f0..ddcee2084 100644
--- a/crates/hir_ty/src/lib.rs
+++ b/crates/hir_ty/src/lib.rs
@@ -74,17 +74,17 @@ pub struct OpaqueTy {
74/// trait and all its parameters are fully known. 74/// trait and all its parameters are fully known.
75#[derive(Clone, PartialEq, Eq, Debug, Hash)] 75#[derive(Clone, PartialEq, Eq, Debug, Hash)]
76pub struct ProjectionTy { 76pub struct ProjectionTy {
77 pub associated_ty: AssocTypeId, 77 pub associated_ty_id: AssocTypeId,
78 pub parameters: Substs, 78 pub substitution: Substs,
79} 79}
80 80
81impl ProjectionTy { 81impl ProjectionTy {
82 pub fn trait_ref(&self, db: &dyn HirDatabase) -> TraitRef { 82 pub fn trait_ref(&self, db: &dyn HirDatabase) -> TraitRef {
83 TraitRef { trait_: self.trait_(db), substs: self.parameters.clone() } 83 TraitRef { trait_: self.trait_(db), substs: self.substitution.clone() }
84 } 84 }
85 85
86 fn trait_(&self, db: &dyn HirDatabase) -> TraitId { 86 fn trait_(&self, db: &dyn HirDatabase) -> TraitId {
87 match from_assoc_type_id(self.associated_ty).lookup(db.upcast()).container { 87 match from_assoc_type_id(self.associated_ty_id).lookup(db.upcast()).container {
88 AssocContainerId::TraitId(it) => it, 88 AssocContainerId::TraitId(it) => it,
89 _ => panic!("projection ty without parent trait"), 89 _ => panic!("projection ty without parent trait"),
90 } 90 }
@@ -93,7 +93,7 @@ impl ProjectionTy {
93 93
94impl TypeWalk for ProjectionTy { 94impl TypeWalk for ProjectionTy {
95 fn walk(&self, f: &mut impl FnMut(&Ty)) { 95 fn walk(&self, f: &mut impl FnMut(&Ty)) {
96 self.parameters.walk(f); 96 self.substitution.walk(f);
97 } 97 }
98 98
99 fn walk_mut_binders( 99 fn walk_mut_binders(
@@ -101,7 +101,7 @@ impl TypeWalk for ProjectionTy {
101 f: &mut impl FnMut(&mut Ty, DebruijnIndex), 101 f: &mut impl FnMut(&mut Ty, DebruijnIndex),
102 binders: DebruijnIndex, 102 binders: DebruijnIndex,
103 ) { 103 ) {
104 self.parameters.walk_mut_binders(f, binders); 104 self.substitution.walk_mut_binders(f, binders);
105 } 105 }
106} 106}
107 107
@@ -945,7 +945,7 @@ impl Ty {
945 } 945 }
946 } 946 }
947 TyKind::Alias(AliasTy::Projection(projection_ty)) => { 947 TyKind::Alias(AliasTy::Projection(projection_ty)) => {
948 match from_assoc_type_id(projection_ty.associated_ty).lookup(db.upcast()).container 948 match from_assoc_type_id(projection_ty.associated_ty_id).lookup(db.upcast()).container
949 { 949 {
950 AssocContainerId::TraitId(trait_id) => Some(trait_id), 950 AssocContainerId::TraitId(trait_id) => Some(trait_id),
951 _ => None, 951 _ => None,
@@ -1055,7 +1055,7 @@ impl TypeWalk for Ty {
1055 fn walk(&self, f: &mut impl FnMut(&Ty)) { 1055 fn walk(&self, f: &mut impl FnMut(&Ty)) {
1056 match self.interned(&Interner) { 1056 match self.interned(&Interner) {
1057 TyKind::Alias(AliasTy::Projection(p_ty)) => { 1057 TyKind::Alias(AliasTy::Projection(p_ty)) => {
1058 for t in p_ty.parameters.iter() { 1058 for t in p_ty.substitution.iter() {
1059 t.walk(f); 1059 t.walk(f);
1060 } 1060 }
1061 } 1061 }
@@ -1087,7 +1087,7 @@ impl TypeWalk for Ty {
1087 ) { 1087 ) {
1088 match &mut self.0 { 1088 match &mut self.0 {
1089 TyKind::Alias(AliasTy::Projection(p_ty)) => { 1089 TyKind::Alias(AliasTy::Projection(p_ty)) => {
1090 p_ty.parameters.walk_mut_binders(f, binders); 1090 p_ty.substitution.walk_mut_binders(f, binders);
1091 } 1091 }
1092 TyKind::Dyn(predicates) => { 1092 TyKind::Dyn(predicates) => {
1093 for p in make_mut_slice(predicates) { 1093 for p in make_mut_slice(predicates) {