Trait rustc_save_analysis::ty::fold::TypeFolder [−][src]
pub trait TypeFolder<'tcx> {
fn tcx(&'a self) -> TyCtxt<'tcx>;
fn fold_binder<T>(&mut self, t: Binder<'tcx, T>) -> Binder<'tcx, T>
where
T: TypeFoldable<'tcx>,
{ ... }
fn fold_ty(&mut self, t: &'tcx TyS<'tcx>) -> &'tcx TyS<'tcx> { ... }
fn fold_region(&mut self, r: &'tcx RegionKind) -> &'tcx RegionKind { ... }
fn fold_const(&mut self, c: &'tcx Const<'tcx>) -> &'tcx Const<'tcx> { ... }
fn fold_predicate(&mut self, p: Predicate<'tcx>) -> Predicate<'tcx> { ... }
fn fold_mir_const(&mut self, c: ConstantKind<'tcx>) -> ConstantKind<'tcx> { ... }
}Expand description
The TypeFolder trait defines the actual folding. There is a
method defined for every foldable type. Each of these has a
default implementation that does an “identity” fold. Within each
identity fold, it should invoke foo.fold_with(self) to fold each
sub-item.