rustc_type_ir::visit

Trait TypeVisitor

source
pub trait TypeVisitor<I: Interner>: Sized {
    type Result: VisitorResult = ();

    // Provided methods
    fn visit_binder<T: TypeVisitable<I>>(
        &mut self,
        t: &Binder<I, T>,
    ) -> Self::Result { ... }
    fn visit_ty(&mut self, t: I::Ty) -> Self::Result { ... }
    fn visit_region(&mut self, r: I::Region) -> Self::Result { ... }
    fn visit_const(&mut self, c: I::Const) -> Self::Result { ... }
    fn visit_predicate(&mut self, p: I::Predicate) -> Self::Result { ... }
    fn visit_clauses(&mut self, p: I::Clauses) -> Self::Result { ... }
    fn visit_error(&mut self, _guar: I::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: TypeVisitable<I>>( &mut self, t: &Binder<I, T>, ) -> Self::Result

source

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

source

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

source

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

source

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

source

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

source

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

Object Safety§

This trait is not object safe.

Implementors§