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, an 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
type Lifted
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Required Methods
fn lift_to_tcx<'a, 'gcx>(
&self,
tcx: TyCtxt<'a, 'gcx, 'tcx>
) -> Option<Self::Lifted>
&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, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Implementations on Foreign Types
impl<'tcx> Lift<'tcx> for ()
[src]
type Lifted = Self
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn lift_to_tcx<'a, 'gcx>(&self, _: TyCtxt<'a, 'gcx, 'tcx>) -> Option<Self>
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'tcx> Lift<'tcx> for Abi
[src]
type Lifted = Self
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn lift_to_tcx<'a, 'gcx>(&self, _: TyCtxt<'a, 'gcx, 'tcx>) -> Option<Self>
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'tcx> Lift<'tcx> for Span
[src]
type Lifted = Self
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn lift_to_tcx<'a, 'gcx>(&self, _: TyCtxt<'a, 'gcx, 'tcx>) -> Option<Self>
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'tcx, A: Lift<'tcx>, B: Lift<'tcx>> Lift<'tcx> for (A, B)
[src]
type Lifted = (A::Lifted, B::Lifted)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn lift_to_tcx<'a, 'gcx>(
&self,
tcx: TyCtxt<'a, 'gcx, 'tcx>
) -> Option<Self::Lifted>
[src]
&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, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'tcx, A: Lift<'tcx>, B: Lift<'tcx>, C: Lift<'tcx>> Lift<'tcx> for (A, B, C)
[src]
type Lifted = (A::Lifted, B::Lifted, C::Lifted)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn lift_to_tcx<'a, 'gcx>(
&self,
tcx: TyCtxt<'a, 'gcx, 'tcx>
) -> Option<Self::Lifted>
[src]
&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, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for Option<T>
[src]
type Lifted = Option<T::Lifted>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn lift_to_tcx<'a, 'gcx>(
&self,
tcx: TyCtxt<'a, 'gcx, 'tcx>
) -> Option<Self::Lifted>
[src]
&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, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'tcx, T: Lift<'tcx>, E: Lift<'tcx>> Lift<'tcx> for Result<T, E>
[src]
type Lifted = Result<T::Lifted, E::Lifted>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn lift_to_tcx<'a, 'gcx>(
&self,
tcx: TyCtxt<'a, 'gcx, 'tcx>
) -> Option<Self::Lifted>
[src]
&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, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for Box<T>
[src]
type Lifted = Box<T::Lifted>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn lift_to_tcx<'a, 'gcx>(
&self,
tcx: TyCtxt<'a, 'gcx, 'tcx>
) -> Option<Self::Lifted>
[src]
&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, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for [T]
[src]
type Lifted = Vec<T::Lifted>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn lift_to_tcx<'a, 'gcx>(
&self,
tcx: TyCtxt<'a, 'gcx, 'tcx>
) -> Option<Self::Lifted>
[src]
&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, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for Vec<T>
[src]
type Lifted = Vec<T::Lifted>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn lift_to_tcx<'a, 'gcx>(
&self,
tcx: TyCtxt<'a, 'gcx, 'tcx>
) -> Option<Self::Lifted>
[src]
&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, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'tcx, I: Idx, T: Lift<'tcx>> Lift<'tcx> for IndexVec<I, T>
[src]
type Lifted = IndexVec<I, T::Lifted>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn lift_to_tcx<'a, 'gcx>(
&self,
tcx: TyCtxt<'a, 'gcx, 'tcx>
) -> Option<Self::Lifted>
[src]
&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, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Implementors
impl<'a, 'tcx> Lift<'tcx> for FreeRegionMap<'a> type Lifted = FreeRegionMap<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for SelectionError<'a> type Lifted = SelectionError<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for ObligationCauseCode<'a> type Lifted = ObligationCauseCode<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for DerivedObligationCause<'a> type Lifted = DerivedObligationCause<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for ObligationCause<'a> type Lifted = ObligationCause<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for Vtable<'a, ()> type Lifted = Vtable<'tcx, ()>;
impl<'a, 'tcx> Lift<'tcx> for Ty<'a> type Lifted = Ty<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for Region<'a> type Lifted = Region<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for &'a Const<'a> type Lifted = &'tcx Const<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for &'a Substs<'a> type Lifted = &'tcx Substs<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for &'a Slice<Ty<'a>> type Lifted = &'tcx Slice<Ty<'tcx>>;
impl<'a, 'tcx> Lift<'tcx> for &'a Slice<ExistentialPredicate<'a>> type Lifted = &'tcx Slice<ExistentialPredicate<'tcx>>;
impl<'a, 'tcx> Lift<'tcx> for &'a Slice<Predicate<'a>> type Lifted = &'tcx Slice<Predicate<'tcx>>;
impl<'tcx> Lift<'tcx> for Unsafety type Lifted = Self;
impl<'tcx> Lift<'tcx> for DefId type Lifted = Self;
impl<'tcx> Lift<'tcx> for Local type Lifted = Self;
impl<'tcx> Lift<'tcx> for Reveal type Lifted = Self;
impl<'a, 'tcx> Lift<'tcx> for TraitRef<'a> type Lifted = TraitRef<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for ExistentialTraitRef<'a> type Lifted = ExistentialTraitRef<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for TraitPredicate<'a> type Lifted = TraitPredicate<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for EquatePredicate<'a> type Lifted = EquatePredicate<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for SubtypePredicate<'a> type Lifted = SubtypePredicate<'tcx>;
impl<'tcx, A: Copy + Lift<'tcx>, B: Copy + Lift<'tcx>> Lift<'tcx> for OutlivesPredicate<A, B> type Lifted = OutlivesPredicate<A::Lifted, B::Lifted>;
impl<'a, 'tcx> Lift<'tcx> for ProjectionTy<'a> type Lifted = ProjectionTy<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for ProjectionPredicate<'a> type Lifted = ProjectionPredicate<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for ExistentialProjection<'a> type Lifted = ExistentialProjection<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for Predicate<'a> type Lifted = Predicate<'tcx>;
impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for Binder<T> type Lifted = Binder<T::Lifted>;
impl<'a, 'tcx> Lift<'tcx> for ParamEnv<'a> type Lifted = ParamEnv<'tcx>;
impl<'a, 'tcx, T: Lift<'tcx>> Lift<'tcx> for ParamEnvAnd<'a, T> type Lifted = ParamEnvAnd<'tcx, T::Lifted>;
impl<'a, 'tcx> Lift<'tcx> for ClosureSubsts<'a> type Lifted = ClosureSubsts<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for GeneratorInterior<'a> type Lifted = GeneratorInterior<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for Adjustment<'a> type Lifted = Adjustment<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for Adjust<'a> type Lifted = Adjust<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for OverloadedDeref<'a> type Lifted = OverloadedDeref<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for AutoBorrow<'a> type Lifted = AutoBorrow<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for GenSig<'a> type Lifted = GenSig<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for FnSig<'a> type Lifted = FnSig<'tcx>;
impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for ExpectedFound<T> type Lifted = ExpectedFound<T::Lifted>;
impl<'a, 'tcx> Lift<'tcx> for Default<'a> type Lifted = Default<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for TypeError<'a> type Lifted = TypeError<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for ConstEvalErr<'a> type Lifted = ConstEvalErr<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for ErrKind<'a> type Lifted = ErrKind<'tcx>;
impl<'a, 'tcx> Lift<'tcx> for LayoutError<'a> type Lifted = LayoutError<'tcx>;