pub trait TypeFoldable<I>: TypeVisitable<I> + Clonewhere
I: Interner,{
// Required methods
fn try_fold_with<F>(
self,
folder: &mut F,
) -> Result<Self, <F as FallibleTypeFolder<I>>::Error>
where F: FallibleTypeFolder<I>;
fn fold_with<F>(self, folder: &mut F) -> Self
where F: TypeFolder<I>;
}Expand description
This trait is implemented for every type that can be folded, providing the skeleton of the traversal.
To implement this conveniently, use the derive macro located in
rustc_macros.
This trait is a sub-trait of TypeVisitable. This is because many
TypeFolder instances use the methods in TypeVisitableExt while folding,
which means in practice almost every foldable type needs to also be
visitable. (However, there are some types that are visitable without being
foldable.)
Required Methods§
Sourcefn try_fold_with<F>(
self,
folder: &mut F,
) -> Result<Self, <F as FallibleTypeFolder<I>>::Error>where
F: FallibleTypeFolder<I>,
fn try_fold_with<F>(
self,
folder: &mut F,
) -> Result<Self, <F as FallibleTypeFolder<I>>::Error>where
F: FallibleTypeFolder<I>,
The entry point for folding. To fold a value t with a folder f
call: t.try_fold_with(f).
For most types, this just traverses the value, calling try_fold_with
on each field/element.
For types of interest (such as Ty), the implementation of this method
calls a folder method specifically for that type (such as
F::try_fold_ty). This is where control transfers from TypeFoldable
to FallibleTypeFolder.
Sourcefn fold_with<F>(self, folder: &mut F) -> Selfwhere
F: TypeFolder<I>,
fn fold_with<F>(self, folder: &mut F) -> Selfwhere
F: TypeFolder<I>,
The entry point for folding. To fold a value t with a folder f
call: t.fold_with(f).
For most types, this just traverses the value, calling fold_with
on each field/element.
For types of interest (such as Ty), the implementation of this method
calls a folder method specifically for that type (such as
F::fold_ty). This is where control transfers from TypeFoldable
to TypeFolder.
Same as TypeFoldable::try_fold_with, but not fallible. Make sure to keep
the behavior in sync across functions.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<'tcx, T: TypeFoldable<TyCtxt<'tcx>> + Debug + Clone> TypeFoldable<TyCtxt<'tcx>> for Spanned<T>
impl<'tcx, T: TypeFoldable<TyCtxt<'tcx>> + Debug + Clone> TypeFoldable<TyCtxt<'tcx>> for Spanned<T>
fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, folder: &mut F, ) -> Result<Self, F::Error>
fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, folder: &mut F) -> Self
Source§impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for CoroutineKind
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for CoroutineKind
fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>
fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self
Source§impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for DefId
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for DefId
fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>
fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self
Source§impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ErrorGuaranteed
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ErrorGuaranteed
fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _folder: &mut F, ) -> Result<Self, F::Error>
fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _folder: &mut F) -> Self
Source§impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for FieldIdx
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for FieldIdx
fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>
fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self
Source§impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for HirId
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for HirId
fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>
fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self
Source§impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Ident
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Ident
fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>
fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self
Source§impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for InlineAsmOptions
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for InlineAsmOptions
fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>
fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self
Source§impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for InlineAsmRegOrRegClass
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for InlineAsmRegOrRegClass
fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>
fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self
Source§impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for InlineAsmTemplatePiece
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for InlineAsmTemplatePiece
fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>
fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self
Source§impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for LocalDefId
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for LocalDefId
fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>
fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self
Source§impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for MatchSource
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for MatchSource
fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>
fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self
Source§impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for RangeEnd
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for RangeEnd
fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>
fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self
Source§impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Span
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Span
fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>
fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self
Source§impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Symbol
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Symbol
fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>
fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self
Source§impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for VariantIdx
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for VariantIdx
fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>
fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self
Source§impl<I, A, B, C> TypeFoldable<I> for (A, B, C)
impl<I, A, B, C> TypeFoldable<I> for (A, B, C)
fn try_fold_with<F>(
self,
folder: &mut F,
) -> Result<(A, B, C), <F as FallibleTypeFolder<I>>::Error>where
F: FallibleTypeFolder<I>,
fn fold_with<F>(self, folder: &mut F) -> (A, B, C)where
F: TypeFolder<I>,
Source§impl<I, T, E> TypeFoldable<I> for Result<T, E>
impl<I, T, E> TypeFoldable<I> for Result<T, E>
fn try_fold_with<F>(
self,
folder: &mut F,
) -> Result<Result<T, E>, <F as FallibleTypeFolder<I>>::Error>where
F: FallibleTypeFolder<I>,
fn fold_with<F>(self, folder: &mut F) -> Result<T, E>where
F: TypeFolder<I>,
Source§impl<I, T, Ix> TypeFoldable<I> for IndexVec<Ix, T>
impl<I, T, Ix> TypeFoldable<I> for IndexVec<Ix, T>
fn try_fold_with<F>(
self,
folder: &mut F,
) -> Result<IndexVec<Ix, T>, <F as FallibleTypeFolder<I>>::Error>where
F: FallibleTypeFolder<I>,
fn fold_with<F>(self, folder: &mut F) -> IndexVec<Ix, T>where
F: TypeFolder<I>,
Source§impl<I, T, U> TypeFoldable<I> for (T, U)
impl<I, T, U> TypeFoldable<I> for (T, U)
fn try_fold_with<F>(
self,
folder: &mut F,
) -> Result<(T, U), <F as FallibleTypeFolder<I>>::Error>where
F: FallibleTypeFolder<I>,
fn fold_with<F>(self, folder: &mut F) -> (T, U)where
F: TypeFolder<I>,
Source§impl<I, T> TypeFoldable<I> for Arc<T>where
I: Interner,
T: TypeFoldable<I>,
impl<I, T> TypeFoldable<I> for Arc<T>where
I: Interner,
T: TypeFoldable<I>,
fn try_fold_with<F>(
self,
folder: &mut F,
) -> Result<Arc<T>, <F as FallibleTypeFolder<I>>::Error>where
F: FallibleTypeFolder<I>,
fn fold_with<F>(self, folder: &mut F) -> Arc<T> ⓘwhere
F: TypeFolder<I>,
Source§impl<I, T> TypeFoldable<I> for Box<T>where
I: Interner,
T: TypeFoldable<I>,
impl<I, T> TypeFoldable<I> for Box<T>where
I: Interner,
T: TypeFoldable<I>,
fn try_fold_with<F>(
self,
folder: &mut F,
) -> Result<Box<T>, <F as FallibleTypeFolder<I>>::Error>where
F: FallibleTypeFolder<I>,
fn fold_with<F>(self, folder: &mut F) -> Box<T>where
F: TypeFolder<I>,
Source§impl<I, T> TypeFoldable<I> for Box<[T]>where
I: Interner,
T: TypeFoldable<I>,
impl<I, T> TypeFoldable<I> for Box<[T]>where
I: Interner,
T: TypeFoldable<I>,
fn try_fold_with<F>(
self,
folder: &mut F,
) -> Result<Box<[T]>, <F as FallibleTypeFolder<I>>::Error>where
F: FallibleTypeFolder<I>,
fn fold_with<F>(self, folder: &mut F) -> Box<[T]>where
F: TypeFolder<I>,
Source§impl<I, T> TypeFoldable<I> for Option<T>where
I: Interner,
T: TypeFoldable<I>,
impl<I, T> TypeFoldable<I> for Option<T>where
I: Interner,
T: TypeFoldable<I>,
fn try_fold_with<F>(
self,
folder: &mut F,
) -> Result<Option<T>, <F as FallibleTypeFolder<I>>::Error>where
F: FallibleTypeFolder<I>,
fn fold_with<F>(self, folder: &mut F) -> Option<T>where
F: TypeFolder<I>,
Source§impl<I, T> TypeFoldable<I> for ThinVec<T>where
I: Interner,
T: TypeFoldable<I>,
impl<I, T> TypeFoldable<I> for ThinVec<T>where
I: Interner,
T: TypeFoldable<I>,
fn try_fold_with<F>(
self,
folder: &mut F,
) -> Result<ThinVec<T>, <F as FallibleTypeFolder<I>>::Error>where
F: FallibleTypeFolder<I>,
fn fold_with<F>(self, folder: &mut F) -> ThinVec<T>where
F: TypeFolder<I>,
Source§impl<I, T> TypeFoldable<I> for Vec<T>where
I: Interner,
T: TypeFoldable<I>,
impl<I, T> TypeFoldable<I> for Vec<T>where
I: Interner,
T: TypeFoldable<I>,
fn try_fold_with<F>(
self,
folder: &mut F,
) -> Result<Vec<T>, <F as FallibleTypeFolder<I>>::Error>where
F: FallibleTypeFolder<I>,
fn fold_with<F>(self, folder: &mut F) -> Vec<T>where
F: TypeFolder<I>,
Source§impl<I> TypeFoldable<I> for ()where
I: Interner,
impl<I> TypeFoldable<I> for ()where
I: Interner,
fn try_fold_with<F>(
self,
_: &mut F,
) -> Result<(), <F as FallibleTypeFolder<I>>::Error>where
F: FallibleTypeFolder<I>,
fn fold_with<F>(self, _: &mut F)where
F: TypeFolder<I>,
Source§impl<I> TypeFoldable<I> for boolwhere
I: Interner,
impl<I> TypeFoldable<I> for boolwhere
I: Interner,
fn try_fold_with<F>(
self,
_: &mut F,
) -> Result<bool, <F as FallibleTypeFolder<I>>::Error>where
F: FallibleTypeFolder<I>,
fn fold_with<F>(self, _: &mut F) -> boolwhere
F: TypeFolder<I>,
Source§impl<I> TypeFoldable<I> for u16where
I: Interner,
impl<I> TypeFoldable<I> for u16where
I: Interner,
fn try_fold_with<F>(
self,
_: &mut F,
) -> Result<u16, <F as FallibleTypeFolder<I>>::Error>where
F: FallibleTypeFolder<I>,
fn fold_with<F>(self, _: &mut F) -> u16where
F: TypeFolder<I>,
Source§impl<I> TypeFoldable<I> for u32where
I: Interner,
impl<I> TypeFoldable<I> for u32where
I: Interner,
fn try_fold_with<F>(
self,
_: &mut F,
) -> Result<u32, <F as FallibleTypeFolder<I>>::Error>where
F: FallibleTypeFolder<I>,
fn fold_with<F>(self, _: &mut F) -> u32where
F: TypeFolder<I>,
Source§impl<I> TypeFoldable<I> for u64where
I: Interner,
impl<I> TypeFoldable<I> for u64where
I: Interner,
fn try_fold_with<F>(
self,
_: &mut F,
) -> Result<u64, <F as FallibleTypeFolder<I>>::Error>where
F: FallibleTypeFolder<I>,
fn fold_with<F>(self, _: &mut F) -> u64where
F: TypeFolder<I>,
Source§impl<I> TypeFoldable<I> for usizewhere
I: Interner,
impl<I> TypeFoldable<I> for usizewhere
I: Interner,
fn try_fold_with<F>(
self,
_: &mut F,
) -> Result<usize, <F as FallibleTypeFolder<I>>::Error>where
F: FallibleTypeFolder<I>,
fn fold_with<F>(self, _: &mut F) -> usizewhere
F: TypeFolder<I>,
Implementors§
impl<'tcx, N> TypeFoldable<TyCtxt<'tcx>> for ImplSource<'tcx, N>where
N: TypeFoldable<TyCtxt<'tcx>>,
impl<'tcx, N> TypeFoldable<TyCtxt<'tcx>> for ImplSourceUserDefinedData<'tcx, N>where
N: TypeFoldable<TyCtxt<'tcx>>,
impl<'tcx, O> TypeFoldable<TyCtxt<'tcx>> for AssertKind<O>where
O: TypeFoldable<TyCtxt<'tcx>>,
impl<'tcx, R> TypeFoldable<TyCtxt<'tcx>> for QueryResponse<'tcx, R>where
R: TypeFoldable<TyCtxt<'tcx>>,
impl<'tcx, T> TypeFoldable<TyCtxt<'tcx>> for ClearCrossCrate<T>where
T: TypeFoldable<TyCtxt<'tcx>>,
impl<'tcx, T> TypeFoldable<TyCtxt<'tcx>> for DeeplyNormalize<T>where
T: TypeFoldable<TyCtxt<'tcx>>,
impl<'tcx, T> TypeFoldable<TyCtxt<'tcx>> for Normalize<T>where
T: TypeFoldable<TyCtxt<'tcx>>,
impl<'tcx, T> TypeFoldable<TyCtxt<'tcx>> for ParamEnvAnd<'tcx, T>where
T: TypeFoldable<TyCtxt<'tcx>>,
impl<'tcx, T> TypeFoldable<TyCtxt<'tcx>> for PseudoCanonicalInput<'tcx, T>where
T: TypeFoldable<TyCtxt<'tcx>>,
impl<'tcx, V, T> TypeFoldable<TyCtxt<'tcx>> for ProjectionElem<V, T>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for &'tcx List<(OpaqueTypeKey<'tcx>, Ty<'tcx>)>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for &'tcx List<ArgOutlivesPredicate<'tcx>>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for &'tcx List<Const<'tcx>>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for &'tcx List<LocalDefId>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for &'tcx List<Pattern<'tcx>>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for &'tcx List<PlaceElem<'tcx>>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for &'tcx List<PolyExistentialPredicate<'tcx>>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for &'tcx List<Ty<'tcx>>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Adjust
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Adjustment<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for AdtKind
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for AggregateKind<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for AnnotationSource
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for AscribeUserType<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for AssocItem
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for AssocKind
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Asyncness
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for AutoBorrow
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for AutoBorrowMutability
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for BackwardIncompatibleDropReason
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for BasicBlock
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for BasicBlockData<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for BasicBlocks<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for BinOp
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for BindingForm<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for BlockTailInfo
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Body<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for rustc_middle::ty::BorrowKind
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for rustc_middle::mir::BorrowKind
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for BoundRegion<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for BoundTy<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Cache
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for CallSource
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for CanonicalUserTypeAnnotation<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for CaptureInfo
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for CapturedPlace<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for rustc_middle::ty::abstract_const::CastKind
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for rustc_middle::mir::CastKind
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for rustc_middle::infer::canonical::Certainty
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Clause<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Clauses<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ClosureSizeProfileData<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for rustc_middle::mir::Const<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for rustc_middle::ty::Const<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ConstOperand<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ConstValue
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ConstraintCategory<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for CopyNonOverlapping<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for CoroutineInfo<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for CoroutineLayout<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for CoroutineSavedLocal
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for CoroutineSavedTy<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for DerefAdjustKind
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for DerivedCause<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for DerivedHostCause<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for DropckOutlives<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for DropckOutlivesResult<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Eq<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Expr<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ExprKind
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ExternalConstraints<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for FakeReadCause
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for GenericArg<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for GenericArgsRef<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for GlobalId<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ImplDerivedCause<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ImplDerivedHostCause<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ImpliedOutlivesBounds<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for InlineAsmMacro
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for InlineAsmOperand<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Instance<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for InstanceKind<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for IsConstable
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Local
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for LocalDecl<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for LocalInfo<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for MatchExpressionArmCause<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for MentionedItem<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for MethodAutoderefSteps<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for MirPhase
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for MirSource<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for NonDivergingIntrinsic<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for NormalizationResult<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for NotConstEvaluatable
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ObligationCause<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ObligationCauseCode<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ObligationCauseCodeHandle<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Operand<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for OutlivesBound<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for OverflowError
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for OverloadedDeref
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ParamEnv<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ParamTy
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for PatAdjust
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for PatAdjustment<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Pattern<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for PatternOriginExpr
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for rustc_middle::hir::place::Place<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for rustc_middle::mir::Place<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for PlaceBase
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for PlaceTy<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for PointerCoercion
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Predicate<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Projection<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ProjectionKind
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Promoted
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ProvePredicate<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ProvisionalHiddenType<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for QueryRegionConstraints<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for RawPtrKind
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Region<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ReifyReason
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ReturnConstraint
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for RuntimeChecks
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Rvalue<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ScalarInt
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for SourceInfo
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for SourceScope
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for SourceScopeData<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for SourceScopeLocalData
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Statement<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for StatementKind<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for StmtDebugInfo<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for StmtDebugInfos<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Subtype<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for SwitchTargets
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Term<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Terminator<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for TerminatorKind<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for TraitPredPrintModifiersAndPath<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for TraitPredPrintWithBoundConstness<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for TraitRefPrintOnlyTraitName<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for TraitRefPrintOnlyTraitPath<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for TraitRefPrintSugared<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Ty<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for TypingEnv<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UnOp
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for rustc_middle::mir::UnevaluatedConst<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UnwindAction
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UnwindTerminateReason
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UpvarArgs<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UpvarCapture
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UpvarId
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UpvarPath
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UserArgs<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UserSelfTy<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UserType<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UserTypeAnnotationIndex
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UserTypeKind<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UserTypeProjection
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UserTypeProjections
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ValTree<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Value<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for VarDebugInfo<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for VarDebugInfoContents<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for VarDebugInfoFragment<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for WellFormedLoc
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for WithRetag
impl<I, A> TypeFoldable<I> for OutlivesPredicate<I, A>
impl<I, P> TypeFoldable<I> for Goal<I, P>
impl<I, P> TypeFoldable<I> for QueryInput<I, P>where
I: Interner,
Goal<I, P>: TypeFoldable<I>,
<I as Interner>::PredefinedOpaques: TypeFoldable<I>,
impl<I, T> !TypeFoldable<I> for EarlyBinder<I, T>where
I: Interner,
For early binders, you should first call instantiate before using any visitors.