//! This module contains impls of `TypeVisitable` for those types that //! introduce binders. //! //! The more interesting impls of `TypeVisitable` remain in the `visit` module. use crate::interner::HasInterner; use crate::{ Binders, Canonical, ControlFlow, DebruijnIndex, FnPointer, Interner, TypeVisitable, TypeVisitor, }; impl TypeVisitable for FnPointer { fn visit_with( &self, visitor: &mut dyn TypeVisitor, outer_binder: DebruijnIndex, ) -> ControlFlow { self.substitution .visit_with(visitor, outer_binder.shifted_in()) } } impl TypeVisitable for Binders where T: HasInterner + TypeVisitable, { fn visit_with( &self, visitor: &mut dyn TypeVisitor, outer_binder: DebruijnIndex, ) -> ControlFlow { self.value.visit_with(visitor, outer_binder.shifted_in()) } } impl TypeVisitable for Canonical where I: Interner, T: HasInterner + TypeVisitable, { fn visit_with( &self, visitor: &mut dyn TypeVisitor, outer_binder: DebruijnIndex, ) -> ControlFlow { self.value.visit_with(visitor, outer_binder.shifted_in()) } }