Trait rustc::ty::Lift [] [src]

pub trait Lift<'tcx> {
    type Lifted;
    fn lift_to_tcx<'a, 'gcx>(
        &self,
        tcx: TyCtxt<'a, 'gcx, 'tcx>
    ) -> Option<Self::Lifted>; }
🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, and unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

A trait implemented for all X<'a> types which can be safely and efficiently converted to X<'tcx> as long as they are part of the provided TyCtxt<'tcx>. This can be done, for example, for Ty<'tcx> or &'tcx Substs<'tcx> by looking them up in their respective interners.

However, this is still not the best implementation as it does need to compare the components, even for interned values. It would be more efficient if TypedArena provided a way to determine whether the address is in the allocated range.

None is returned if the value or one of the components is not part of the provided context. For Ty, None can be returned if either the type interner doesn't contain the TypeVariants key or if the address of the interned pointer differs. The latter case is possible if a primitive type, e.g. () or u8, was interned in a different context.

Associated Types

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, and unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Required Methods

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, and unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Implementors