Trait rustc_middle::ty::context::Lift [−][src]
pub trait Lift<'tcx>: Debug { type Lifted: Debug + 'tcx; fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted>; }
Expand description
A trait implemented for all X<'a> types that 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 SubstsRef<'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 TyKind 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
Required methods
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted>[src]Implementations on Foreign Types
type Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = SelfImplementors
type Lifted = ImplSourceAutoImplData<N::Lifted>type Lifted = ImplSourceBuiltinData<N::Lifted>type Lifted = WithOptConstParam<T::Lifted>type Lifted = &'tcx Allocationtype Lifted = &'tcx List<BoundVariableKind>type Lifted = &'tcx List<CanonicalVarInfo<'tcx>>type Lifted = &'tcx List<Binder<'tcx, ExistentialPredicate<'tcx>>>type Lifted = &'tcx List<GenericArg<'tcx>>type Lifted = &'tcx List<ProjectionKind>type Lifted = &'tcx PredicateInner<'tcx>type Lifted = ConstValue<'tcx>type Lifted = AutoBorrow<'tcx>type Lifted = PredicateKind<'tcx>type Lifted = InstanceDef<'tcx>type Lifted = ExistentialPredicate<'tcx>type Lifted = Adjustment<'tcx>type Lifted = OverloadedDeref<'tcx>type Lifted = ProjectionPredicate<'tcx>type Lifted = SubtypePredicate<'tcx>type Lifted = TraitPredicate<'tcx>type Lifted = ClosureSubsts<'tcx>type Lifted = ExistentialProjection<'tcx>type Lifted = ExistentialTraitRef<'tcx>type Lifted = GeneratorSubsts<'tcx>type Lifted = ProjectionTy<'tcx>type Lifted = GenericArg<'tcx>type Lifted = ParamEnvAnd<'tcx, T::Lifted>type Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = StatementAsExpressiontype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = Selftype Lifted = ConstantKind<'__lifted>type Lifted = ObligationCauseCode<'__lifted>type Lifted = SelectionError<'__lifted>type Lifted = OutlivesBound<'__lifted>type Lifted = CanonicalVarValues<'__lifted>type Lifted = QueryRegionConstraints<'__lifted>type Lifted = MemberConstraint<'__lifted>type Lifted = DropckOutlivesResult<'__lifted>type Lifted = NormalizationResult<'__lifted>type Lifted = AscribeUserType<'__lifted>type Lifted = ProvePredicate<'__lifted>type Lifted = DerivedObligationCause<'__lifted>type Lifted = MatchExpressionArmCause<'__lifted>type Lifted = ObligationCause<'__lifted>type Lifted = ObligationCauseData<'__lifted>type Lifted = UnifyReceiverContext<'__lifted>type Lifted = TraitRefPrintOnlyTraitPath<'__lifted>fn lift_to_tcx(
self,
__tcx: TyCtxt<'__lifted>
) -> Option<TraitRefPrintOnlyTraitPath<'__lifted>>[src]type Lifted = TypeAndMut<'__lifted>type Lifted = UserSelfTy<'__lifted>type Lifted = UserSubsts<'__lifted>type Lifted = CanonicalUserTypeAnnotation<'__lifted>fn lift_to_tcx(
self,
__tcx: TyCtxt<'__lifted>
) -> Option<CanonicalUserTypeAnnotation<'__lifted>>[src]type Lifted = ImplSource<'__lifted, N::Lifted>impl<'tcx, '__lifted, N> Lift<'__lifted> for ImplSourceClosureData<'tcx, N> where
N: Lift<'__lifted>, [src]
impl<'tcx, '__lifted, N> Lift<'__lifted> for ImplSourceClosureData<'tcx, N> where
N: Lift<'__lifted>, [src]type Lifted = ImplSourceClosureData<'__lifted, N::Lifted>fn lift_to_tcx(
self,
__tcx: TyCtxt<'__lifted>
) -> Option<ImplSourceClosureData<'__lifted, N::Lifted>>[src]impl<'tcx, '__lifted, N> Lift<'__lifted> for ImplSourceFnPointerData<'tcx, N> where
N: Lift<'__lifted>, [src]
impl<'tcx, '__lifted, N> Lift<'__lifted> for ImplSourceFnPointerData<'tcx, N> where
N: Lift<'__lifted>, [src]type Lifted = ImplSourceFnPointerData<'__lifted, N::Lifted>fn lift_to_tcx(
self,
__tcx: TyCtxt<'__lifted>
) -> Option<ImplSourceFnPointerData<'__lifted, N::Lifted>>[src]impl<'tcx, '__lifted, N> Lift<'__lifted> for ImplSourceGeneratorData<'tcx, N> where
N: Lift<'__lifted>, [src]
impl<'tcx, '__lifted, N> Lift<'__lifted> for ImplSourceGeneratorData<'tcx, N> where
N: Lift<'__lifted>, [src]type Lifted = ImplSourceGeneratorData<'__lifted, N::Lifted>fn lift_to_tcx(
self,
__tcx: TyCtxt<'__lifted>
) -> Option<ImplSourceGeneratorData<'__lifted, N::Lifted>>[src]impl<'tcx, '__lifted, N> Lift<'__lifted> for ImplSourceObjectData<'tcx, N> where
N: Lift<'__lifted>, [src]
impl<'tcx, '__lifted, N> Lift<'__lifted> for ImplSourceObjectData<'tcx, N> where
N: Lift<'__lifted>, [src]type Lifted = ImplSourceObjectData<'__lifted, N::Lifted>fn lift_to_tcx(
self,
__tcx: TyCtxt<'__lifted>
) -> Option<ImplSourceObjectData<'__lifted, N::Lifted>>[src]impl<'tcx, '__lifted, N> Lift<'__lifted> for ImplSourceTraitAliasData<'tcx, N> where
N: Lift<'__lifted>, [src]
impl<'tcx, '__lifted, N> Lift<'__lifted> for ImplSourceTraitAliasData<'tcx, N> where
N: Lift<'__lifted>, [src]type Lifted = ImplSourceTraitAliasData<'__lifted, N::Lifted>fn lift_to_tcx(
self,
__tcx: TyCtxt<'__lifted>
) -> Option<ImplSourceTraitAliasData<'__lifted, N::Lifted>>[src]impl<'tcx, '__lifted, N> Lift<'__lifted> for ImplSourceUserDefinedData<'tcx, N> where
N: Lift<'__lifted>, [src]
impl<'tcx, '__lifted, N> Lift<'__lifted> for ImplSourceUserDefinedData<'tcx, N> where
N: Lift<'__lifted>, [src]type Lifted = ImplSourceUserDefinedData<'__lifted, N::Lifted>fn lift_to_tcx(
self,
__tcx: TyCtxt<'__lifted>
) -> Option<ImplSourceUserDefinedData<'__lifted, N::Lifted>>[src]type Lifted = QueryResponse<'__lifted, R::Lifted>type Lifted = OutlivesPredicate<A::Lifted, B::Lifted>type Lifted = ExpectedFound<T::Lifted>