TypeFoldable in rustc_middle::ty - Rust
Description: This trait is implemented for every type that can be folded, providing the skeleton of the traversal.

Skip to main content

## TypeFoldable

# Trait TypeFoldable

Source

    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§

Source

#### 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`.

Source

#### fn fold_with<F>(self, folder: &mut F) -> Self
where 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", so this trait is not object safe.

## Implementations on Foreign Types§

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for InlineAsmTemplatePiece

Source§

#### fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>

Source§

#### fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for CoroutineKind

Source§

#### fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>

Source§

#### fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for MatchSource

Source§

#### fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>

Source§

#### fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for RangeEnd

Source§

#### fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>

Source§

#### fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for InlineAsmRegOrRegClass

Source§

#### fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>

Source§

#### fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for FieldIdx

Source§

#### fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>

Source§

#### fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for VariantIdx

Source§

#### fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>

Source§

#### fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for InlineAsmOptions

Source§

#### fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>

Source§

#### fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for HirId

Source§

#### fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>

Source§

#### fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for DefId

Source§

#### fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>

Source§

#### fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for LocalDefId

Source§

#### fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>

Source§

#### fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Span

Source§

#### fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>

Source§

#### fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ErrorGuaranteed

Source§

#### fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _folder: &mut F, ) -> Result<Self, F::Error>

Source§

#### fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _folder: &mut F) -> Self

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Ident

Source§

#### fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>

Source§

#### fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Symbol

Source§

#### fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, _: &mut F, ) -> Result<Self, F::Error>

Source§

#### fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, _: &mut F) -> Self

Source§

### impl<'tcx, T: TypeFoldable<TyCtxt<'tcx>> + Debug + Clone> TypeFoldable<TyCtxt<'tcx>> for Spanned<T>

Source§

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

Source§

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

Source§

### impl<I> TypeFoldable<I> for bool
where I: Interner,

Source§

#### fn try_fold_with<F>( self, _: &mut F, ) -> Result<bool, <F as FallibleTypeFolder<I>>::Error>
where F: FallibleTypeFolder<I>,

Source§

#### fn fold_with<F>(self, _: &mut F) -> bool
where F: TypeFolder<I>,

Source§

### impl<I> TypeFoldable<I> for u16
where I: Interner,

Source§

#### fn try_fold_with<F>( self, _: &mut F, ) -> Result<u16, <F as FallibleTypeFolder<I>>::Error>
where F: FallibleTypeFolder<I>,

Source§

#### fn fold_with<F>(self, _: &mut F) -> u16
where F: TypeFolder<I>,

Source§

### impl<I> TypeFoldable<I> for u32
where I: Interner,

Source§

#### fn try_fold_with<F>( self, _: &mut F, ) -> Result<u32, <F as FallibleTypeFolder<I>>::Error>
where F: FallibleTypeFolder<I>,

Source§

#### fn fold_with<F>(self, _: &mut F) -> u32
where F: TypeFolder<I>,

Source§

### impl<I> TypeFoldable<I> for u64
where I: Interner,

Source§

#### fn try_fold_with<F>( self, _: &mut F, ) -> Result<u64, <F as FallibleTypeFolder<I>>::Error>
where F: FallibleTypeFolder<I>,

Source§

#### fn fold_with<F>(self, _: &mut F) -> u64
where F: TypeFolder<I>,

Source§

### impl<I> TypeFoldable<I> for ()
where I: Interner,

Source§

#### fn try_fold_with<F>( self, _: &mut F, ) -> Result<(), <F as FallibleTypeFolder<I>>::Error>
where F: FallibleTypeFolder<I>,

Source§

#### fn fold_with<F>(self, _: &mut F)
where F: TypeFolder<I>,

Source§

### impl<I> TypeFoldable<I> for usize
where I: Interner,

Source§

#### fn try_fold_with<F>( self, _: &mut F, ) -> Result<usize, <F as FallibleTypeFolder<I>>::Error>
where F: FallibleTypeFolder<I>,

Source§

#### fn fold_with<F>(self, _: &mut F) -> usize
where F: TypeFolder<I>,

Source§

### impl<I, A, B, C> TypeFoldable<I> for (A, B, C)
where I: Interner, A: TypeFoldable<I>, B: TypeFoldable<I>, C: TypeFoldable<I>,

Source§

#### fn try_fold_with<F>( self, folder: &mut F, ) -> Result<(A, B, C), <F as FallibleTypeFolder<I>>::Error>
where F: FallibleTypeFolder<I>,

Source§

#### fn fold_with<F>(self, folder: &mut F) -> (A, B, C)
where F: TypeFolder<I>,

Source§

### impl<I, T> TypeFoldable<I> for Option<T>
where I: Interner, T: TypeFoldable<I>,

Source§

#### fn try_fold_with<F>( self, folder: &mut F, ) -> Result<Option<T>, <F as FallibleTypeFolder<I>>::Error>
where F: FallibleTypeFolder<I>,

Source§

#### fn fold_with<F>(self, folder: &mut F) -> Option<T>
where F: TypeFolder<I>,

Source§

### impl<I, T> TypeFoldable<I> for Box<[T]>
where I: Interner, T: TypeFoldable<I>,

Source§

#### fn try_fold_with<F>( self, folder: &mut F, ) -> Result<Box<[T]>, <F as FallibleTypeFolder<I>>::Error>
where F: FallibleTypeFolder<I>,

Source§

#### 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>,

Source§

#### fn try_fold_with<F>( self, folder: &mut F, ) -> Result<Box<T>, <F as FallibleTypeFolder<I>>::Error>
where F: FallibleTypeFolder<I>,

Source§

#### fn fold_with<F>(self, folder: &mut F) -> Box<T>
where F: TypeFolder<I>,

Source§

### impl<I, T> TypeFoldable<I> for Arc<T>
where I: Interner, T: TypeFoldable<I>,

Source§

#### fn try_fold_with<F>( self, folder: &mut F, ) -> Result<Arc<T>, <F as FallibleTypeFolder<I>>::Error>
where F: FallibleTypeFolder<I>,

Source§

#### fn fold_with<F>(self, folder: &mut F) -> Arc<T>
where F: TypeFolder<I>,

Source§

### impl<I, T> TypeFoldable<I> for Vec<T>
where I: Interner, T: TypeFoldable<I>,

Source§

#### fn try_fold_with<F>( self, folder: &mut F, ) -> Result<Vec<T>, <F as FallibleTypeFolder<I>>::Error>
where F: FallibleTypeFolder<I>,

Source§

#### fn fold_with<F>(self, folder: &mut F) -> Vec<T>
where F: TypeFolder<I>,

Source§

### impl<I, T> TypeFoldable<I> for ThinVec<T>
where I: Interner, T: TypeFoldable<I>,

Source§

#### fn try_fold_with<F>( self, folder: &mut F, ) -> Result<ThinVec<T>, <F as FallibleTypeFolder<I>>::Error>
where F: FallibleTypeFolder<I>,

Source§

#### fn fold_with<F>(self, folder: &mut F) -> ThinVec<T>
where F: TypeFolder<I>,

Source§

### impl<I, T, E> TypeFoldable<I> for Result<T, E>
where I: Interner, T: TypeFoldable<I>, E: TypeFoldable<I>,

Source§

#### fn try_fold_with<F>( self, folder: &mut F, ) -> Result<Result<T, E>, <F as FallibleTypeFolder<I>>::Error>
where F: FallibleTypeFolder<I>,

Source§

#### 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>
where I: Interner, T: TypeFoldable<I>, Ix: Idx,

Source§

#### fn try_fold_with<F>( self, folder: &mut F, ) -> Result<IndexVec<Ix, T>, <F as FallibleTypeFolder<I>>::Error>
where F: FallibleTypeFolder<I>,

Source§

#### 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)
where I: Interner, T: TypeFoldable<I>, U: TypeFoldable<I>,

Source§

#### fn try_fold_with<F>( self, folder: &mut F, ) -> Result<(T, U), <F as FallibleTypeFolder<I>>::Error>
where F: FallibleTypeFolder<I>,

Source§

#### fn fold_with<F>(self, folder: &mut F) -> (T, U)
where F: TypeFolder<I>,

## Implementors§

Source§

### impl<I, T> !TypeFoldable<I> for EarlyBinder<I, T>
where I: Interner,

Available on crate feature `nightly` only.

For early binders, you should first call `instantiate` before using any visitors.

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for &'tcx List<(OpaqueTypeKey<'tcx>, Ty<'tcx>)>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for &'tcx List<LocalDefId>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for &'tcx List<Pattern<'tcx>>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for &'tcx List<Const<'tcx>>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for &'tcx List<Ty<'tcx>>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for &'tcx List<PlaceElem<'tcx>>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for &'tcx List<ArgOutlivesPredicate<'tcx>>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for &'tcx List<PolyExistentialPredicate<'tcx>>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for PlaceBase

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ProjectionKind

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for rustc_middle::infer::canonical::Certainty

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for AggregateKind<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for AnnotationSource

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for BackwardIncompatibleDropReason

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for BinOp

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for BindingForm<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for rustc_middle::mir::BorrowKind

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for CallSource

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for rustc_middle::mir::CastKind

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for rustc_middle::mir::Const<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ConstValue

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ConstraintCategory<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for FakeReadCause

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for InlineAsmMacro

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for InlineAsmOperand<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for LocalInfo<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for MentionedItem<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for MirPhase

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for NonDivergingIntrinsic<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Operand<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for RawPtrKind

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for RetagKind

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ReturnConstraint

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for RuntimeChecks

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Rvalue<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for StatementKind<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for StmtDebugInfo<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for TerminatorKind<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UnOp

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UnwindAction

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UnwindTerminateReason

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for VarDebugInfoContents<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for IsConstable

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ObligationCauseCode<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for WellFormedLoc

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for OutlivesBound<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for OverflowError

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for rustc_middle::ty::abstract_const::CastKind

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for NotConstEvaluatable

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Adjust

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for AutoBorrow

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for AutoBorrowMutability

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for DerefAdjustKind

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for PatAdjust

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for PointerCoercion

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for AdtKind

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for AssocKind

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Asyncness

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for rustc_middle::ty::BorrowKind

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ExprKind

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for InstanceKind<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ReifyReason

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UpvarArgs<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UpvarCapture

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UserTypeKind<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for rustc_middle::hir::place::Place<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Projection<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for QueryRegionConstraints<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Cache

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for GlobalId<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for BasicBlock

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for BasicBlockData<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for BasicBlocks<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for BlockTailInfo

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Body<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ConstOperand<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for CopyNonOverlapping<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for CoroutineInfo<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for CoroutineLayout<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for CoroutineSavedLocal

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for CoroutineSavedTy<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Local

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for LocalDecl<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for MirSource<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for rustc_middle::mir::Place<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for PlaceTy<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Promoted

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for SourceInfo

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for SourceScope

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for SourceScopeData<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for SourceScopeLocalData

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Statement<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for StmtDebugInfos<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for SwitchTargets

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Terminator<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for rustc_middle::mir::UnevaluatedConst<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UserTypeProjection

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UserTypeProjections

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for VarDebugInfo<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for VarDebugInfoFragment<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for DropckOutlivesResult<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for MethodAutoderefSteps<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for NormalizationResult<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for AscribeUserType<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for DropckOutlives<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Eq<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ImpliedOutlivesBounds<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ProvePredicate<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Subtype<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ExternalConstraints<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for DerivedCause<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for DerivedHostCause<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ImplDerivedCause<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ImplDerivedHostCause<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for MatchExpressionArmCause<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ObligationCause<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ObligationCauseCodeHandle<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for PatternOriginExpr

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Adjustment<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for OverloadedDeref

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for PatAdjustment<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Pattern<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for TraitPredPrintModifiersAndPath<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for TraitPredPrintWithBoundConstness<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for TraitRefPrintOnlyTraitName<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for TraitRefPrintOnlyTraitPath<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for TraitRefPrintSugared<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for AssocItem

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for CanonicalUserTypeAnnotation<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for CaptureInfo

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for CapturedPlace<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Clause<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ClosureSizeProfileData<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for rustc_middle::ty::Const<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Expr<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for GenericArg<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Instance<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for InstantiatedPredicates<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ParamEnv<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ParamTy

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Predicate<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ProvisionalHiddenType<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Region<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ScalarInt

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Term<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Ty<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for TypingEnv<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UpvarId

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UpvarPath

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UserArgs<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UserSelfTy<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UserType<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for UserTypeAnnotationIndex

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ValTree<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Value<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for BoundRegion<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for BoundTy<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Clauses<'tcx>

Source§

### impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for GenericArgsRef<'tcx>

Source§

### impl<'tcx, N> TypeFoldable<TyCtxt<'tcx>> for ImplSource<'tcx, N>
where N: TypeFoldable<TyCtxt<'tcx>>,

Source§

### impl<'tcx, N> TypeFoldable<TyCtxt<'tcx>> for ImplSourceUserDefinedData<'tcx, N>
where N: TypeFoldable<TyCtxt<'tcx>>,

Source§

### impl<'tcx, O> TypeFoldable<TyCtxt<'tcx>> for AssertKind<O>
where O: TypeFoldable<TyCtxt<'tcx>>,

Source§

### impl<'tcx, R> TypeFoldable<TyCtxt<'tcx>> for QueryResponse<'tcx, R>
where R: TypeFoldable<TyCtxt<'tcx>>,

Source§

### impl<'tcx, T> TypeFoldable<TyCtxt<'tcx>> for ClearCrossCrate<T>
where T: TypeFoldable<TyCtxt<'tcx>>,

Source§

### impl<'tcx, T> TypeFoldable<TyCtxt<'tcx>> for DeeplyNormalize<T>
where T: TypeFoldable<TyCtxt<'tcx>>,

Source§

### impl<'tcx, T> TypeFoldable<TyCtxt<'tcx>> for Normalize<T>
where T: TypeFoldable<TyCtxt<'tcx>>,

Source§

### impl<'tcx, T> TypeFoldable<TyCtxt<'tcx>> for ParamEnvAnd<'tcx, T>
where T: TypeFoldable<TyCtxt<'tcx>>,

Source§

### impl<'tcx, T> TypeFoldable<TyCtxt<'tcx>> for PseudoCanonicalInput<'tcx, T>
where T: TypeFoldable<TyCtxt<'tcx>>,

Source§

### impl<'tcx, V, T> TypeFoldable<TyCtxt<'tcx>> for ProjectionElem<V, T>
where T: TypeFoldable<TyCtxt<'tcx>>, V: TypeFoldable<TyCtxt<'tcx>>,

Source§

### impl<I> TypeFoldable<I> for PatternKind<I>
where I: Interner, <I as Interner>::Const: TypeFoldable<I>, <I as Interner>::PatList: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for ExistentialPredicate<I>
where I: Interner, ExistentialTraitRef<I>: TypeFoldable<I>, ExistentialProjection<I>: TypeFoldable<I>, <I as Interner>::TraitId: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for ClauseKind<I>
where I: Interner, TraitPredicate<I>: TypeFoldable<I>, OutlivesPredicate<I, <I as Interner>::Region>: TypeFoldable<I>, OutlivesPredicate<I, <I as Interner>::Ty>: TypeFoldable<I>, ProjectionPredicate<I>: TypeFoldable<I>, <I as Interner>::Const: TypeFoldable<I>, <I as Interner>::Ty: TypeFoldable<I>, <I as Interner>::Term: TypeFoldable<I>, HostEffectPredicate<I>: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for PredicateKind<I>
where I: Interner, ClauseKind<I>: TypeFoldable<I>, <I as Interner>::TraitId: TypeFoldable<I>, SubtypePredicate<I>: TypeFoldable<I>, CoercePredicate<I>: TypeFoldable<I>, <I as Interner>::Const: TypeFoldable<I>, NormalizesTo<I>: TypeFoldable<I>, <I as Interner>::Term: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for Mutability
where I: Interner,

Source§

### impl<I> TypeFoldable<I> for BuiltinImplSource
where I: Interner,

Source§

### impl<I> TypeFoldable<I> for AliasBoundKind
where I: Interner,

Source§

### impl<I> TypeFoldable<I> for rustc_middle::traits::solve::Certainty
where I: Interner,

Source§

### impl<I> TypeFoldable<I> for GoalSource
where I: Interner,

Source§

### impl<I> TypeFoldable<I> for ProbeKind<I>
where I: Interner, Result<Canonical<I, Response<I>>, NoSolution>: TypeFoldable<I>, CandidateSource<I>: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for AliasRelationDirection
where I: Interner,

Source§

### impl<I> TypeFoldable<I> for BoundConstness
where I: Interner,

Source§

### impl<I> TypeFoldable<I> for BoundVarIndexKind
where I: Interner,

Source§

### impl<I> TypeFoldable<I> for PredicatePolarity
where I: Interner,

Source§

### impl<I> TypeFoldable<I> for ValTreeKind<I>
where I: Interner, <I as Interner>::ScalarInt: TypeFoldable<I>, <I as Interner>::Consts: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for Variance
where I: Interner,

Source§

### impl<I> TypeFoldable<I> for rustc_type_ir::const_kind::UnevaluatedConst<I>
where I: Interner, <I as Interner>::UnevaluatedConstId: TypeFoldable<I>, <I as Interner>::GenericArgs: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for OpaqueTypeKey<I>
where I: Interner, <I as Interner>::LocalDefId: TypeFoldable<I>, <I as Interner>::GenericArgs: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for AliasTerm<I>
where I: Interner, <I as Interner>::GenericArgs: TypeFoldable<I>, <I as Interner>::DefId: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for CoercePredicate<I>
where I: Interner, <I as Interner>::Ty: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for ExistentialProjection<I>
where I: Interner, <I as Interner>::DefId: TypeFoldable<I>, <I as Interner>::GenericArgs: TypeFoldable<I>, <I as Interner>::Term: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for ExistentialTraitRef<I>
where I: Interner, <I as Interner>::TraitId: TypeFoldable<I>, <I as Interner>::GenericArgs: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for HostEffectPredicate<I>
where I: Interner, TraitRef<I>: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for NormalizesTo<I>
where I: Interner, AliasTerm<I>: TypeFoldable<I>, <I as Interner>::Term: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for ProjectionPredicate<I>
where I: Interner, AliasTerm<I>: TypeFoldable<I>, <I as Interner>::Term: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for SubtypePredicate<I>
where I: Interner, <I as Interner>::Ty: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for TraitPredicate<I>
where I: Interner, TraitRef<I>: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for TraitRef<I>
where I: Interner, <I as Interner>::TraitId: TypeFoldable<I>, <I as Interner>::GenericArgs: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for AliasTy<I>
where I: Interner, <I as Interner>::GenericArgs: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for FnSig<I>
where I: Interner, <I as Interner>::Tys: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for TypeAndMut<I>
where I: Interner, <I as Interner>::Ty: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for ExternalConstraintsData<I>
where I: Interner, Vec<OutlivesPredicate<I, <I as Interner>::GenericArg>>: TypeFoldable<I>, Vec<(OpaqueTypeKey<I>, <I as Interner>::Ty)>: TypeFoldable<I>, NestedNormalizationGoals<I>: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for NestedNormalizationGoals<I>
where I: Interner, Vec<(GoalSource, Goal<I, <I as Interner>::Predicate>)>: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for Response<I>
where I: Interner, CanonicalVarValues<I>: TypeFoldable<I>, <I as Interner>::ExternalConstraints: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for CanonicalVarValues<I>
where I: Interner, <I as Interner>::GenericArgs: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for ClosureArgs<I>
where I: Interner, <I as Interner>::GenericArgs: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for CoroutineArgs<I>
where I: Interner, <I as Interner>::GenericArgs: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for CoroutineClosureArgs<I>
where I: Interner, <I as Interner>::GenericArgs: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for CoroutineClosureSignature<I>
where I: Interner, <I as Interner>::Ty: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for CoroutineWitnessTypes<I>
where I: Interner, <I as Interner>::Tys: TypeFoldable<I>, <I as Interner>::RegionAssumptions: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for DebruijnIndex
where I: Interner,

Source§

### impl<I> TypeFoldable<I> for FnHeader<I>
where I: Interner, <I as Interner>::Safety: TypeFoldable<I>, <I as Interner>::Abi: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for FnSigTys<I>
where I: Interner, <I as Interner>::Tys: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for GenSig<I>
where I: Interner, <I as Interner>::Ty: TypeFoldable<I>,

Source§

### impl<I> TypeFoldable<I> for UniverseIndex
where I: Interner,

Source§

### impl<I> TypeFoldable<I> for UnsafeBinderInner<I>
where I: Interner, Binder<I, <I as Interner>::Ty>: TypeFoldable<I>,

Source§

### impl<I, A> TypeFoldable<I> for OutlivesPredicate<I, A>
where I: Interner, A: TypeFoldable<I>, <I as Interner>::Region: TypeFoldable<I>,

Source§

### impl<I, P> TypeFoldable<I> for Goal<I, P>
where I: Interner, <I as Interner>::ParamEnv: TypeFoldable<I>, P: TypeFoldable<I>,

Source§

### impl<I, P> TypeFoldable<I> for QueryInput<I, P>
where I: Interner, Goal<I, P>: TypeFoldable<I>, <I as Interner>::PredefinedOpaques: TypeFoldable<I>,

Source§

### impl<I, T> TypeFoldable<I> for Binder<I, T>
where I: Interner, T: TypeFoldable<I>,

Source§

### impl<I, T> TypeFoldable<I> for State<I, T>
where I: Interner, CanonicalVarValues<I>: TypeFoldable<I>, T: TypeFoldable<I>,

Source§

### impl<I, T> TypeFoldable<I> for Placeholder<I, T>
where I: Interner, T: TypeFoldable<I>,

Source§

### impl<T, I> TypeFoldable<I> for ExpectedFound<T>
where I: Interner, T: TypeFoldable<I>,