Trait rustc_infer::infer::canonical::ir::visit::TypeVisitor

source ·
pub trait TypeVisitor<I>: Sized
where I: Interner,
{ type Result: VisitorResult = (); // Provided methods fn visit_binder<T>(&mut self, t: &Binder<I, T>) -> Self::Result where T: TypeVisitable<I> { ... } fn visit_ty(&mut self, t: <I as Interner>::Ty) -> Self::Result { ... } fn visit_region(&mut self, r: <I as Interner>::Region) -> Self::Result { ... } fn visit_const(&mut self, c: <I as Interner>::Const) -> Self::Result { ... } fn visit_predicate(&mut self, p: <I as Interner>::Predicate) -> Self::Result { ... } fn visit_clauses(&mut self, p: <I as Interner>::Clauses) -> Self::Result { ... } fn visit_error( &mut self, _guar: <I as Interner>::ErrorGuaranteed, ) -> Self::Result { ... } }
Expand description

This trait is implemented for every visiting traversal. There is a visit method defined for every type of interest. Each such method has a default that recurses into the type’s fields in a non-custom fashion.

Provided Associated Types§

Provided Methods§

source

fn visit_binder<T>(&mut self, t: &Binder<I, T>) -> Self::Result
where T: TypeVisitable<I>,

source

fn visit_ty(&mut self, t: <I as Interner>::Ty) -> Self::Result

source

fn visit_region(&mut self, r: <I as Interner>::Region) -> Self::Result

source

fn visit_const(&mut self, c: <I as Interner>::Const) -> Self::Result

source

fn visit_predicate(&mut self, p: <I as Interner>::Predicate) -> Self::Result

source

fn visit_clauses(&mut self, p: <I as Interner>::Clauses) -> Self::Result

source

fn visit_error( &mut self, _guar: <I as Interner>::ErrorGuaranteed, ) -> Self::Result

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for IsSuggestableVisitor<'tcx>

§

type Result = ControlFlow<()>

source§

fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<()>

source§

fn visit_const(&mut self, c: Const<'tcx>) -> ControlFlow<()>

source§

impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for MaxUniverse

source§

fn visit_ty(&mut self, t: Ty<'tcx>)

source§

fn visit_const(&mut self, c: Const<'tcx>)

source§

fn visit_region(&mut self, r: Region<'tcx>)

Implementors§

source§

impl<'tcx, OP> TypeVisitor<TyCtxt<'tcx>> for ConstrainOpaqueTypeRegionVisitor<'tcx, OP>
where OP: FnMut(Region<'tcx>),

source§

impl<'tcx, OP> TypeVisitor<TyCtxt<'tcx>> for FreeRegionsVisitor<'tcx, OP>
where OP: FnMut(Region<'tcx>),

source§

impl<I> TypeVisitor<I> for ValidateBoundVars<I>
where I: Interner,