pub trait TypeSuperFoldable<'tcx>: TypeFoldable<'tcx> {
    // Required method
    fn try_super_fold_with<F: FallibleTypeFolder<'tcx>>(
self,
folder: &mut F
) -> Result<Self, F::Error>; // Provided method fn super_fold_with<F: TypeFolder<'tcx>>(self, folder: &mut F) -> Self { ... } }

Required Methods§

source

fn try_super_fold_with<F: FallibleTypeFolder<'tcx>>(
self,
folder: &mut F
) -> Result<Self, F::Error>

Provides a default fold for a type of interest. This should only be called within TypeFolder methods, when a non-custom traversal is desired for the value of the type of interest passed to that method. For example, in MyFolder::try_fold_ty(ty), it is valid to call ty.try_super_fold_with(self), but any other folding should be done with xyz.try_fold_with(self).

Provided Methods§

source

fn super_fold_with<F: TypeFolder<'tcx>>(self, folder: &mut F) -> Self

A convenient alternative to try_super_fold_with for use with infallible folders. Do not override this method, to ensure coherence with try_super_fold_with.

Implementors§

source§

impl<'tcx> TypeSuperFoldable<'tcx> for Const<'tcx>

source§

impl<'tcx> TypeSuperFoldable<'tcx> for Predicate<'tcx>

source§

impl<'tcx> TypeSuperFoldable<'tcx> for Ty<'tcx>

source§

impl<'tcx> TypeSuperFoldable<'tcx> for Region<'tcx>

source§

impl<'tcx, T: TypeFoldable<'tcx>> TypeSuperFoldable<'tcx> for Binder<'tcx, T>