aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/walk.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/walk.rs')
-rw-r--r--crates/hir_ty/src/walk.rs26
1 files changed, 16 insertions, 10 deletions
diff --git a/crates/hir_ty/src/walk.rs b/crates/hir_ty/src/walk.rs
index 41ebf6137..91116dcda 100644
--- a/crates/hir_ty/src/walk.rs
+++ b/crates/hir_ty/src/walk.rs
@@ -162,13 +162,15 @@ impl TypeWalk for Ty {
162 TyKind::Function(fn_pointer) => { 162 TyKind::Function(fn_pointer) => {
163 fn_pointer.substitution.0.walk(f); 163 fn_pointer.substitution.0.walk(f);
164 } 164 }
165 _ => { 165 TyKind::Adt(_, substs)
166 if let Some(substs) = self.substs() { 166 | TyKind::FnDef(_, substs)
167 for t in substs.iter(&Interner) { 167 | TyKind::Tuple(_, substs)
168 t.walk(f); 168 | TyKind::OpaqueType(_, substs)
169 } 169 | TyKind::AssociatedType(_, substs)
170 } 170 | TyKind::Closure(.., substs) => {
171 substs.walk(f);
171 } 172 }
173 _ => {}
172 } 174 }
173 f(self); 175 f(self);
174 } 176 }
@@ -199,11 +201,15 @@ impl TypeWalk for Ty {
199 TyKind::Function(fn_pointer) => { 201 TyKind::Function(fn_pointer) => {
200 fn_pointer.substitution.0.walk_mut_binders(f, binders.shifted_in()); 202 fn_pointer.substitution.0.walk_mut_binders(f, binders.shifted_in());
201 } 203 }
202 _ => { 204 TyKind::Adt(_, substs)
203 if let Some(substs) = self.substs_mut() { 205 | TyKind::FnDef(_, substs)
204 substs.walk_mut_binders(f, binders); 206 | TyKind::Tuple(_, substs)
205 } 207 | TyKind::OpaqueType(_, substs)
208 | TyKind::AssociatedType(_, substs)
209 | TyKind::Closure(.., substs) => {
210 substs.walk_mut_binders(f, binders);
206 } 211 }
212 _ => {}
207 } 213 }
208 f(self, binders); 214 f(self, binders);
209 } 215 }