Type Alias rustc_infer::traits::PolyTraitObligation

source ·
pub type PolyTraitObligation<'tcx> = Obligation<'tcx, PolyTraitPredicate<'tcx>>;

Aliased Type§

struct PolyTraitObligation<'tcx> {
    pub cause: ObligationCause<'tcx>,
    pub param_env: ParamEnv<'tcx>,
    pub predicate: Binder<TyCtxt<'tcx>, TraitPredicate<TyCtxt<'tcx>>>,
    pub recursion_depth: usize,
}

Fields§

§cause: ObligationCause<'tcx>

The reason we have to prove this thing.

§param_env: ParamEnv<'tcx>

The environment in which we should prove this thing.

§predicate: Binder<TyCtxt<'tcx>, TraitPredicate<TyCtxt<'tcx>>>

The thing we are trying to prove.

§recursion_depth: usize

If we started proving this as a result of trying to prove something else, track the total depth to ensure termination. If this goes over a certain threshold, we abort compilation – in such cases, we can not say whether or not the predicate holds for certain. Stupid halting problem; such a drag.

Implementations§

source§

impl<'tcx> PolyTraitObligation<'tcx>

source

pub fn derived_cause( &self, variant: impl FnOnce(DerivedCause<'tcx>) -> ObligationCauseCode<'tcx>, ) -> ObligationCause<'tcx>

source§

impl<'tcx> PolyTraitObligation<'tcx>

source

pub fn polarity(&self) -> PredicatePolarity

source

pub fn self_ty(&self) -> Binder<'tcx, Ty<'tcx>>

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 72 bytes