Trait rustc_type_ir::lift::Lift

source ·
pub trait Lift<I>: Debug {
    type Lifted: Debug;

    // Required method
    fn lift_to_interner(self, cx: I) -> 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 GenericArgsRef<'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.

Required Associated Types§

Required Methods§

source

fn lift_to_interner(self, cx: I) -> Option<Self::Lifted>

Implementors§

source§

impl<I, J> Lift<J> for ExistentialPredicate<I>
where I: Interner, J: Interner, ExistentialTraitRef<I>: Lift<J, Lifted = ExistentialTraitRef<J>>, ExistentialProjection<I>: Lift<J, Lifted = ExistentialProjection<J>>, I::DefId: Lift<J, Lifted = J::DefId>,

source§

impl<I, J> Lift<J> for CanonicalVarValues<I>
where I: Interner, J: Interner, I::GenericArgs: Lift<J, Lifted = J::GenericArgs>,

source§

impl<I, J> Lift<J> for UnevaluatedConst<I>
where I: Interner, J: Interner, I::DefId: Lift<J, Lifted = J::DefId>, I::GenericArgs: Lift<J, Lifted = J::GenericArgs>,

source§

impl<I, J> Lift<J> for AliasTerm<I>
where I: Interner, J: Interner, I::GenericArgs: Lift<J, Lifted = J::GenericArgs>, I::DefId: Lift<J, Lifted = J::DefId>, (): Lift<J, Lifted = ()>,

source§

impl<I, J> Lift<J> for CoercePredicate<I>
where I: Interner, J: Interner, I::Ty: Lift<J, Lifted = J::Ty>,

source§

impl<I, J> Lift<J> for ExistentialProjection<I>
where I: Interner, J: Interner, I::DefId: Lift<J, Lifted = J::DefId>, I::GenericArgs: Lift<J, Lifted = J::GenericArgs>, I::Term: Lift<J, Lifted = J::Term>,

source§

impl<I, J> Lift<J> for ExistentialTraitRef<I>
where I: Interner, J: Interner, I::DefId: Lift<J, Lifted = J::DefId>, I::GenericArgs: Lift<J, Lifted = J::GenericArgs>,

source§

impl<I, J> Lift<J> for NormalizesTo<I>
where I: Interner, J: Interner, AliasTerm<I>: Lift<J, Lifted = AliasTerm<J>>, I::Term: Lift<J, Lifted = J::Term>,

source§

impl<I, J> Lift<J> for ProjectionPredicate<I>
where I: Interner, J: Interner, AliasTerm<I>: Lift<J, Lifted = AliasTerm<J>>, I::Term: Lift<J, Lifted = J::Term>,

source§

impl<I, J> Lift<J> for SubtypePredicate<I>
where I: Interner, J: Interner, bool: Lift<J, Lifted = bool>, I::Ty: Lift<J, Lifted = J::Ty>,

source§

impl<I, J> Lift<J> for TraitPredicate<I>
where I: Interner, J: Interner, TraitRef<I>: Lift<J, Lifted = TraitRef<J>>, PredicatePolarity: Lift<J, Lifted = PredicatePolarity>,

source§

impl<I, J> Lift<J> for TraitRef<I>
where I: Interner, J: Interner, I::DefId: Lift<J, Lifted = J::DefId>, I::GenericArgs: Lift<J, Lifted = J::GenericArgs>, (): Lift<J, Lifted = ()>,

source§

impl<I, J> Lift<J> for ClosureArgs<I>
where I: Interner, J: Interner, I::GenericArgs: Lift<J, Lifted = J::GenericArgs>,

source§

impl<I, J> Lift<J> for CoroutineArgs<I>
where I: Interner, J: Interner, I::GenericArgs: Lift<J, Lifted = J::GenericArgs>,

source§

impl<I, J> Lift<J> for CoroutineClosureArgs<I>
where I: Interner, J: Interner, I::GenericArgs: Lift<J, Lifted = J::GenericArgs>,

source§

impl<I, J> Lift<J> for AliasTy<I>
where I: Interner, J: Interner, I::GenericArgs: Lift<J, Lifted = J::GenericArgs>, I::DefId: Lift<J, Lifted = J::DefId>, (): Lift<J, Lifted = ()>,

source§

impl<I, J> Lift<J> for FnHeader<I>
where I: Interner, J: Interner, bool: Lift<J, Lifted = bool>, I::Safety: Lift<J, Lifted = J::Safety>, I::Abi: Lift<J, Lifted = J::Abi>,

source§

impl<I, J> Lift<J> for FnSig<I>
where I: Interner, J: Interner, I::Tys: Lift<J, Lifted = J::Tys>, bool: Lift<J, Lifted = bool>, I::Safety: Lift<J, Lifted = J::Safety>, I::Abi: Lift<J, Lifted = J::Abi>,

source§

impl<I, J> Lift<J> for FnSigTys<I>
where I: Interner, J: Interner, I::Tys: Lift<J, Lifted = J::Tys>,

source§

impl<I, P, J> Lift<J> for Goal<I, P>
where I: Interner, J: Interner, I::ParamEnv: Lift<J, Lifted = J::ParamEnv>, P: Lift<J, Lifted = P>,

source§

type Lifted = Goal<J, P>

source§

impl<I: Interner, U: Interner, A> Lift<U> for OutlivesPredicate<I, A>
where A: Lift<U>, I::Region: Lift<U, Lifted = U::Region>,

source§

impl<I: Interner, U: Interner, T> Lift<U> for Binder<I, T>
where T: Lift<U>, I::BoundVarKinds: Lift<U, Lifted = U::BoundVarKinds>,

source§

type Lifted = Binder<U, <T as Lift<U>>::Lifted>