Trait rustc::ty::fold::TypeFolder
[−]
[src]
pub trait TypeFolder<'gcx: 'tcx, 'tcx>: Sized {
fn tcx<'a>(&'a self) -> TyCtxt<'a, 'gcx, 'tcx>;
fn fold_binder<T>(&mut self, t: &Binder<T>) -> Binder<T> where T: TypeFoldable<'tcx> { ... }
fn fold_ty(&mut self, t: Ty<'tcx>) -> Ty<'tcx> { ... }
fn fold_mt(&mut self, t: &TypeAndMut<'tcx>) -> TypeAndMut<'tcx> { ... }
fn fold_impl_header(&mut self, imp: &ImplHeader<'tcx>) -> ImplHeader<'tcx> { ... }
fn fold_substs(&mut self, substs: &'tcx Substs<'tcx>) -> &'tcx Substs<'tcx> { ... }
fn fold_fn_sig(&mut self, sig: &FnSig<'tcx>) -> FnSig<'tcx> { ... }
fn fold_region(&mut self, r: &'tcx Region) -> &'tcx Region { ... }
fn fold_autoref(&mut self, ar: &AutoBorrow<'tcx>) -> AutoBorrow<'tcx> { ... }
}
🔬 This is a nightly-only experimental API. (
rustc_private
)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.
Required Methods
fn tcx<'a>(&'a self) -> TyCtxt<'a, 'gcx, 'tcx>
🔬 This is a nightly-only experimental API. (
rustc_private
)Provided Methods
fn fold_binder<T>(&mut self, t: &Binder<T>) -> Binder<T> where T: TypeFoldable<'tcx>
🔬 This is a nightly-only experimental API. (
rustc_private
)fn fold_ty(&mut self, t: Ty<'tcx>) -> Ty<'tcx>
🔬 This is a nightly-only experimental API. (
rustc_private
)fn fold_mt(&mut self, t: &TypeAndMut<'tcx>) -> TypeAndMut<'tcx>
🔬 This is a nightly-only experimental API. (
rustc_private
)fn fold_impl_header(&mut self, imp: &ImplHeader<'tcx>) -> ImplHeader<'tcx>
🔬 This is a nightly-only experimental API. (
rustc_private
)fn fold_substs(&mut self, substs: &'tcx Substs<'tcx>) -> &'tcx Substs<'tcx>
🔬 This is a nightly-only experimental API. (
rustc_private
)fn fold_fn_sig(&mut self, sig: &FnSig<'tcx>) -> FnSig<'tcx>
🔬 This is a nightly-only experimental API. (
rustc_private
)fn fold_region(&mut self, r: &'tcx Region) -> &'tcx Region
🔬 This is a nightly-only experimental API. (
rustc_private
)fn fold_autoref(&mut self, ar: &AutoBorrow<'tcx>) -> AutoBorrow<'tcx>
🔬 This is a nightly-only experimental API. (
rustc_private
)Implementors
impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for OpportunisticTypeResolver<'a, 'gcx, 'tcx>
impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for OpportunisticTypeAndRegionResolver<'a, 'gcx, 'tcx>
impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for TypeFreshener<'a, 'gcx, 'tcx>
impl<'a, 'gcx, 'tcx, F> TypeFolder<'gcx, 'tcx> for BottomUpFolder<'a, 'gcx, 'tcx, F> where F: FnMut(Ty<'tcx>) -> Ty<'tcx>
impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for RegionFolder<'a, 'gcx, 'tcx>