[][src]Trait rustc_middle::ty::context::Lift

pub trait Lift<'tcx>: Debug {
    type Lifted: Debug + 'tcx;
    pub fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted>;
}

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

type Lifted: Debug + 'tcx[src]

Loading content...

Required methods

pub fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted>[src]

Loading content...

Implementations on Foreign Types

impl<'tcx> Lift<'tcx> for Constness[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for ()[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for bool[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for usize[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for VariantIdx[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for u32[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for u64[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for String[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for FloatTy[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for InlineAsmOptions[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for InlineAsmTemplatePiece[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for NodeId[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for Symbol[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for Res[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for DefId[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for LocalDefId[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for HirId[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for LlvmInlineAsmInner[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for MatchSource[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for Unsafety[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for InlineAsmRegOrRegClass[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for Abi[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for Span[src]

type Lifted = Self

impl<'tcx, A: Lift<'tcx>, B: Lift<'tcx>> Lift<'tcx> for (A, B)[src]

type Lifted = (A::Lifted, B::Lifted)

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)

impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for Option<T>[src]

type Lifted = Option<T::Lifted>

impl<'tcx, T: Lift<'tcx>, E: Lift<'tcx>> Lift<'tcx> for Result<T, E>[src]

type Lifted = Result<T::Lifted, E::Lifted>

impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for Box<T>[src]

type Lifted = Box<T::Lifted>

impl<'tcx, T: Lift<'tcx> + Clone> Lift<'tcx> for Rc<T>[src]

type Lifted = Rc<T::Lifted>

impl<'tcx, T: Lift<'tcx> + Clone> Lift<'tcx> for Arc<T>[src]

type Lifted = Arc<T::Lifted>

impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for Vec<T>[src]

type Lifted = Vec<T::Lifted>

impl<'tcx, I: Idx, T: Lift<'tcx>> Lift<'tcx> for IndexVec<I, T>[src]

type Lifted = IndexVec<I, T::Lifted>

Loading content...

Implementors

impl<'__lifted, N> Lift<'__lifted> for ImplSourceAutoImplData<N> where
    N: Lift<'__lifted>, 
[src]

type Lifted = ImplSourceAutoImplData<N::Lifted>

impl<'__lifted, N> Lift<'__lifted> for ImplSourceBuiltinData<N> where
    N: Lift<'__lifted>, 
[src]

type Lifted = ImplSourceBuiltinData<N::Lifted>

impl<'__lifted, T> Lift<'__lifted> for Normalize<T> where
    T: Lift<'__lifted>, 
[src]

type Lifted = Normalize<T::Lifted>

impl<'__lifted, T> Lift<'__lifted> for WithOptConstParam<T> where
    T: Lift<'__lifted>, 
[src]

type Lifted = WithOptConstParam<T::Lifted>

impl<'a, 'tcx> Lift<'tcx> for &'a Const<'a>[src]

type Lifted = &'tcx Const<'tcx>

impl<'a, 'tcx> Lift<'tcx> for &'a List<ExistentialPredicate<'a>>[src]

type Lifted = &'tcx List<ExistentialPredicate<'tcx>>

impl<'a, 'tcx> Lift<'tcx> for &'a List<CanonicalVarInfo<'a>>[src]

type Lifted = &'tcx List<CanonicalVarInfo<'tcx>>

impl<'a, 'tcx> Lift<'tcx> for &'a List<Predicate<'a>>[src]

type Lifted = &'tcx List<Predicate<'tcx>>

impl<'a, 'tcx> Lift<'tcx> for &'a List<GenericArg<'a>>[src]

type Lifted = &'tcx List<GenericArg<'tcx>>

impl<'a, 'tcx> Lift<'tcx> for &'a List<ProjectionKind>[src]

type Lifted = &'tcx List<ProjectionKind>

impl<'a, 'tcx> Lift<'tcx> for &'a List<Ty<'a>>[src]

type Lifted = &'tcx List<Ty<'tcx>>

impl<'a, 'tcx> Lift<'tcx> for &'a PredicateInner<'a>[src]

type Lifted = &'tcx PredicateInner<'tcx>

impl<'a, 'tcx> Lift<'tcx> for Adjust<'a>[src]

type Lifted = Adjust<'tcx>

impl<'a, 'tcx> Lift<'tcx> for AutoBorrow<'a>[src]

type Lifted = AutoBorrow<'tcx>

impl<'a, 'tcx> Lift<'tcx> for PredicateAtom<'a>[src]

type Lifted = PredicateAtom<'tcx>

impl<'a, 'tcx> Lift<'tcx> for PredicateKind<'a>[src]

type Lifted = PredicateKind<'tcx>

impl<'a, 'tcx> Lift<'tcx> for TypeError<'a>[src]

type Lifted = TypeError<'tcx>

impl<'a, 'tcx> Lift<'tcx> for InstanceDef<'a>[src]

type Lifted = InstanceDef<'tcx>

impl<'a, 'tcx> Lift<'tcx> for ExistentialPredicate<'a>[src]

type Lifted = ExistentialPredicate<'tcx>

impl<'a, 'tcx> Lift<'tcx> for Adjustment<'a>[src]

type Lifted = Adjustment<'tcx>

impl<'a, 'tcx> Lift<'tcx> for OverloadedDeref<'a>[src]

type Lifted = OverloadedDeref<'tcx>

impl<'a, 'tcx> Lift<'tcx> for ParamEnv<'a>[src]

type Lifted = ParamEnv<'tcx>

impl<'a, 'tcx> Lift<'tcx> for ProjectionPredicate<'a>[src]

type Lifted = ProjectionPredicate<'tcx>

impl<'a, 'tcx> Lift<'tcx> for SubtypePredicate<'a>[src]

type Lifted = SubtypePredicate<'tcx>

impl<'a, 'tcx> Lift<'tcx> for TraitPredicate<'a>[src]

type Lifted = TraitPredicate<'tcx>

impl<'a, 'tcx> Lift<'tcx> for ClosureSubsts<'a>[src]

type Lifted = ClosureSubsts<'tcx>

impl<'a, 'tcx> Lift<'tcx> for ExistentialProjection<'a>[src]

type Lifted = ExistentialProjection<'tcx>

impl<'a, 'tcx> Lift<'tcx> for ExistentialTraitRef<'a>[src]

type Lifted = ExistentialTraitRef<'tcx>

impl<'a, 'tcx> Lift<'tcx> for FnSig<'a>[src]

type Lifted = FnSig<'tcx>

impl<'a, 'tcx> Lift<'tcx> for GenSig<'a>[src]

type Lifted = GenSig<'tcx>

impl<'a, 'tcx> Lift<'tcx> for GeneratorSubsts<'a>[src]

type Lifted = GeneratorSubsts<'tcx>

impl<'a, 'tcx> Lift<'tcx> for ProjectionTy<'a>[src]

type Lifted = ProjectionTy<'tcx>

impl<'a, 'tcx> Lift<'tcx> for TraitRef<'a>[src]

type Lifted = TraitRef<'tcx>

impl<'a, 'tcx> Lift<'tcx> for GenericArg<'a>[src]

type Lifted = GenericArg<'tcx>

impl<'a, 'tcx> Lift<'tcx> for Region<'a>[src]

type Lifted = Region<'tcx>

impl<'a, 'tcx> Lift<'tcx> for Ty<'a>[src]

type Lifted = Ty<'tcx>

impl<'a, 'tcx, T: Lift<'tcx>> Lift<'tcx> for ParamEnvAnd<'a, T>[src]

type Lifted = ParamEnvAnd<'tcx, T::Lifted>

impl<'tcx> Lift<'tcx> for CanonicalVarKind<'tcx>[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for Certainty[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for BindingForm<'tcx>[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for FakeReadCause[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for MirPhase[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for RetagKind[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for ErrorHandled[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for Mutability[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for Reveal[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for StatementAsExpression[src]

impl<'tcx> Lift<'tcx> for AutoBorrowMutability[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for PointerCast[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for BindingMode[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for AdtKind[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for ClosureKind[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for IntVarValue[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for Variance[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for BoundRegion[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for InferTy[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for CanonicalVarInfo<'tcx>[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for Scope[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for CounterValueReference[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for ExpressionOperandId[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for InjectedExpressionId[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for InjectedExpressionIndex[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for MappedExpressionIndex[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for PredecessorCache[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for BlockTailInfo[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for Local[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for Promoted[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for SourceInfo[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for SourceScope[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for SourceScopeLocalData[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for IfExpressionCause[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for ImplSourceDiscriminantKindData[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for UserTypeAnnotationIndex[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for AssocItem[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for Placeholder<BoundRegion>[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for UniverseIndex[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for FreeRegion[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for ParamConst[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for ParamTy[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for RegionVid[src]

type Lifted = Self

impl<'tcx> Lift<'tcx> for ProjectionKind[src]

type Lifted = Self

impl<'tcx, '__lifted> Lift<'__lifted> for ObligationCauseCode<'tcx>[src]

type Lifted = ObligationCauseCode<'__lifted>

impl<'tcx, '__lifted> Lift<'__lifted> for SelectionError<'tcx>[src]

type Lifted = SelectionError<'__lifted>

impl<'tcx, '__lifted> Lift<'__lifted> for OutlivesBound<'tcx>[src]

type Lifted = OutlivesBound<'__lifted>

impl<'tcx, '__lifted> Lift<'__lifted> for UserType<'tcx>[src]

type Lifted = UserType<'__lifted>

impl<'tcx, '__lifted> Lift<'__lifted> for CanonicalVarValues<'tcx>[src]

type Lifted = CanonicalVarValues<'__lifted>

impl<'tcx, '__lifted> Lift<'__lifted> for QueryRegionConstraints<'tcx>[src]

type Lifted = QueryRegionConstraints<'__lifted>

impl<'tcx, '__lifted> Lift<'__lifted> for MemberConstraint<'tcx>[src]

type Lifted = MemberConstraint<'__lifted>

impl<'tcx, '__lifted> Lift<'__lifted> for GlobalId<'tcx>[src]

type Lifted = GlobalId<'__lifted>

impl<'tcx, '__lifted> Lift<'__lifted> for DropckOutlivesResult<'tcx>[src]

type Lifted = DropckOutlivesResult<'__lifted>

impl<'tcx, '__lifted> Lift<'__lifted> for NormalizationResult<'tcx>[src]

type Lifted = NormalizationResult<'__lifted>

impl<'tcx, '__lifted> Lift<'__lifted> for AscribeUserType<'tcx>[src]

type Lifted = AscribeUserType<'__lifted>

impl<'tcx, '__lifted> Lift<'__lifted> for Eq<'tcx>[src]

type Lifted = Eq<'__lifted>

impl<'tcx, '__lifted> Lift<'__lifted> for ProvePredicate<'tcx>[src]

type Lifted = ProvePredicate<'__lifted>

impl<'tcx, '__lifted> Lift<'__lifted> for Subtype<'tcx>[src]

type Lifted = Subtype<'__lifted>

impl<'tcx, '__lifted> Lift<'__lifted> for DerivedObligationCause<'tcx>[src]

type Lifted = DerivedObligationCause<'__lifted>

impl<'tcx, '__lifted> Lift<'__lifted> for MatchExpressionArmCause<'tcx>[src]

type Lifted = MatchExpressionArmCause<'__lifted>

impl<'tcx, '__lifted> Lift<'__lifted> for ObligationCause<'tcx>[src]

type Lifted = ObligationCause<'__lifted>

impl<'tcx, '__lifted> Lift<'__lifted> for ObligationCauseData<'tcx>[src]

type Lifted = ObligationCauseData<'__lifted>

impl<'tcx, '__lifted> Lift<'__lifted> for UnifyReceiverContext<'tcx>[src]

type Lifted = UnifyReceiverContext<'__lifted>

impl<'tcx, '__lifted> Lift<'__lifted> for CanonicalUserTypeAnnotation<'tcx>[src]

type Lifted = CanonicalUserTypeAnnotation<'__lifted>

impl<'tcx, '__lifted> Lift<'__lifted> for Instance<'tcx>[src]

type Lifted = Instance<'__lifted>

impl<'tcx, '__lifted> Lift<'__lifted> for TraitRefPrintOnlyTraitPath<'tcx>[src]

type Lifted = TraitRefPrintOnlyTraitPath<'__lifted>

impl<'tcx, '__lifted> Lift<'__lifted> for Predicate<'tcx>[src]

type Lifted = Predicate<'__lifted>

impl<'tcx, '__lifted> Lift<'__lifted> for TypeAndMut<'tcx>[src]

type Lifted = TypeAndMut<'__lifted>

impl<'tcx, '__lifted> Lift<'__lifted> for UserSelfTy<'tcx>[src]

type Lifted = UserSelfTy<'__lifted>

impl<'tcx, '__lifted> Lift<'__lifted> for UserSubsts<'tcx>[src]

type Lifted = UserSubsts<'__lifted>

impl<'tcx, '__lifted, N> Lift<'__lifted> for ImplSource<'tcx, N> where
    N: Lift<'__lifted>, 
[src]

type Lifted = ImplSource<'__lifted, N::Lifted>

impl<'tcx, '__lifted, N> Lift<'__lifted> for ImplSourceClosureData<'tcx, N> where
    N: Lift<'__lifted>, 
[src]

type Lifted = ImplSourceClosureData<'__lifted, N::Lifted>

impl<'tcx, '__lifted, N> Lift<'__lifted> for ImplSourceFnPointerData<'tcx, N> where
    N: Lift<'__lifted>, 
[src]

type Lifted = ImplSourceFnPointerData<'__lifted, N::Lifted>

impl<'tcx, '__lifted, N> Lift<'__lifted> for ImplSourceGeneratorData<'tcx, N> where
    N: Lift<'__lifted>, 
[src]

type Lifted = ImplSourceGeneratorData<'__lifted, N::Lifted>

impl<'tcx, '__lifted, N> Lift<'__lifted> for ImplSourceObjectData<'tcx, N> where
    N: Lift<'__lifted>, 
[src]

type Lifted = ImplSourceObjectData<'__lifted, N::Lifted>

impl<'tcx, '__lifted, N> Lift<'__lifted> for ImplSourceTraitAliasData<'tcx, N> where
    N: Lift<'__lifted>, 
[src]

type Lifted = ImplSourceTraitAliasData<'__lifted, N::Lifted>

impl<'tcx, '__lifted, N> Lift<'__lifted> for ImplSourceUserDefinedData<'tcx, N> where
    N: Lift<'__lifted>, 
[src]

type Lifted = ImplSourceUserDefinedData<'__lifted, N::Lifted>

impl<'tcx, '__lifted, R> Lift<'__lifted> for QueryResponse<'tcx, R> where
    R: Lift<'__lifted>, 
[src]

type Lifted = QueryResponse<'__lifted, R::Lifted>

impl<'tcx, '__lifted, V> Lift<'__lifted> for Canonical<'tcx, V> where
    V: Lift<'__lifted>, 
[src]

type Lifted = Canonical<'__lifted, V::Lifted>

impl<'tcx, A: Copy + Lift<'tcx>, B: Copy + Lift<'tcx>> Lift<'tcx> for OutlivesPredicate<A, B>[src]

type Lifted = OutlivesPredicate<A::Lifted, B::Lifted>

impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for ExpectedFound<T>[src]

type Lifted = ExpectedFound<T::Lifted>

impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for Binder<T>[src]

type Lifted = Binder<T::Lifted>

Loading content...