//! `TypeFoldable` implementations for MIR types use rustc_ast::InlineAsmTemplatePiece; use super::*; use crate::ty; TrivialTypeTraversalAndLiftImpls! { BlockTailInfo, MirPhase, SourceInfo, FakeReadCause, RetagKind, SourceScope, SourceScopeLocalData, UserTypeAnnotationIndex, BorrowKind, CastKind, NullOp, hir::Movability, BasicBlock, SwitchTargets, GeneratorKind, GeneratorSavedLocal, } TrivialTypeTraversalImpls! { for <'tcx> { ConstValue<'tcx>, } } impl<'tcx> TypeFoldable> for &'tcx [InlineAsmTemplatePiece] { fn try_fold_with>>( self, _folder: &mut F, ) -> Result { Ok(self) } } impl<'tcx> TypeFoldable> for &'tcx [Span] { fn try_fold_with>>( self, _folder: &mut F, ) -> Result { Ok(self) } } impl<'tcx> TypeFoldable> for &'tcx ty::List> { fn try_fold_with>>( self, folder: &mut F, ) -> Result { ty::util::fold_list(self, folder, |tcx, v| tcx.mk_place_elems(v)) } }