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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<I: Interner> TypeVisitor<I> for OutlivesCollector<'_, I>

Source§

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

Source§

impl<I: Interner> TypeVisitor<I> for HasRegionsBoundAt

Source§

impl<I: Interner> TypeVisitor<I> for HasErrorVisitor

Source§

impl<I: Interner> TypeVisitor<I> for HasEscapingVarsVisitor

Source§

impl<I: Interner> TypeVisitor<I> for HasTypeFlagsVisitor

impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for FindOpaqueRegion<'_, 'tcx>

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

impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for CollectParams<'_, 'tcx>

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

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

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

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

impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for UncoveredTyParamCollector<'_, 'tcx>

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

impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for GenericParamAndBoundVarCollector<'_, 'tcx>

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

impl<'tcx, VarFn, OutlivesFn> TypeVisitor<TyCtxt<'tcx>> for VisitOpaqueTypes<'tcx, VarFn, OutlivesFn>
where VarFn: FnOnce() -> FxHashMap<DefId, Variance>, OutlivesFn: FnOnce() -> OutlivesEnvironment<'tcx>,

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

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

impl<'a, Infcx, I, F, E> TypeVisitor<I> for OrphanChecker<'a, Infcx, I, F>
where Infcx: InferCtxtLike<Interner = I>, I: Interner, F: FnMut(I::Ty) -> Result<I::Ty, E>,

impl<'tcx, V> TypeVisitor<TyCtxt<'tcx>> for DefIdVisitorSkeleton<'_, 'tcx, V>
where V: DefIdVisitor<'tcx> + ?Sized,

impl<'a, 'tcx> TypeVisitor<TyCtxt<'tcx>> for WfPredicates<'a, 'tcx>

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

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

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

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

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

impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for ImplTraitInTraitFinder<'_, 'tcx>