diff options
author | Florian Diebold <[email protected]> | 2021-04-05 21:23:16 +0100 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2021-04-05 21:23:30 +0100 |
commit | edc59d897d56815e8b9814cdc4ff084100e4f3b4 (patch) | |
tree | 054c1874844107ba3f5ae0e17736213a6cb974ce /crates/hir_ty/src/walk.rs | |
parent | f25c1e7c6a119a1035ba226f0735a0d6667a5db8 (diff) |
Align FnPointer with Chalk
Diffstat (limited to 'crates/hir_ty/src/walk.rs')
-rw-r--r-- | crates/hir_ty/src/walk.rs | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/crates/hir_ty/src/walk.rs b/crates/hir_ty/src/walk.rs index b85e6ab4d..963eb12c8 100644 --- a/crates/hir_ty/src/walk.rs +++ b/crates/hir_ty/src/walk.rs | |||
@@ -6,8 +6,9 @@ use std::mem; | |||
6 | use chalk_ir::DebruijnIndex; | 6 | use chalk_ir::DebruijnIndex; |
7 | 7 | ||
8 | use crate::{ | 8 | use crate::{ |
9 | utils::make_mut_slice, AliasEq, AliasTy, Binders, CallableSig, GenericArg, GenericArgData, | 9 | utils::make_mut_slice, AliasEq, AliasTy, Binders, CallableSig, FnSubst, GenericArg, |
10 | Interner, OpaqueTy, ProjectionTy, Substitution, TraitRef, Ty, TyKind, WhereClause, | 10 | GenericArgData, Interner, OpaqueTy, ProjectionTy, Substitution, TraitRef, Ty, TyKind, |
11 | WhereClause, | ||
11 | }; | 12 | }; |
12 | 13 | ||
13 | /// This allows walking structures that contain types to do something with those | 14 | /// This allows walking structures that contain types to do something with those |
@@ -381,3 +382,17 @@ impl TypeWalk for AliasEq { | |||
381 | } | 382 | } |
382 | } | 383 | } |
383 | } | 384 | } |
385 | |||
386 | impl TypeWalk for FnSubst { | ||
387 | fn walk(&self, f: &mut impl FnMut(&Ty)) { | ||
388 | self.0.walk(f) | ||
389 | } | ||
390 | |||
391 | fn walk_mut_binders( | ||
392 | &mut self, | ||
393 | f: &mut impl FnMut(&mut Ty, DebruijnIndex), | ||
394 | binders: DebruijnIndex, | ||
395 | ) { | ||
396 | self.0.walk_mut_binders(f, binders) | ||
397 | } | ||
398 | } | ||