[][src]Trait rustc::ty::fold::TypeFolder

pub trait TypeFolder<'tcx>: Sized {
    fn tcx<'a>(&'a self) -> TyCtxt<'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_region(&mut self, r: Region<'tcx>) -> Region<'tcx> { ... }
fn fold_const(&mut self, c: &'tcx Const<'tcx>) -> &'tcx Const<'tcx> { ... } }
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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<'tcx>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Loading content...

Provided methods

fn fold_binder<T>(&mut self, t: &Binder<T>) -> Binder<T> where
    T: TypeFoldable<'tcx>, 

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn fold_ty(&mut self, t: Ty<'tcx>) -> Ty<'tcx>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn fold_region(&mut self, r: Region<'tcx>) -> Region<'tcx>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn fold_const(&mut self, c: &'tcx Const<'tcx>) -> &'tcx Const<'tcx>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Loading content...

Implementors

impl<'a, 'tcx> TypeFolder<'tcx> for BoundVarReplacer<'a, 'tcx>[src]

impl<'a, 'tcx> TypeFolder<'tcx> for RegionFolder<'a, 'tcx>[src]

impl<'a, 'tcx> TypeFolder<'tcx> for SubstFolder<'a, 'tcx>[src]

impl<'tcx> TypeFolder<'tcx> for RegionEraserVisitor<'tcx>[src]

impl<'tcx> TypeFolder<'tcx> for Shifter<'tcx>[src]

impl<'tcx> TypeFolder<'tcx> for NormalizeAfterErasingRegionsFolder<'tcx>[src]

impl<'tcx, F, G, H> TypeFolder<'tcx> for BottomUpFolder<'tcx, F, G, H> where
    F: FnMut(Ty<'tcx>) -> Ty<'tcx>,
    G: FnMut(Region<'tcx>) -> Region<'tcx>,
    H: FnMut(&'tcx Const<'tcx>) -> &'tcx Const<'tcx>, 
[src]

Loading content...