Skip to main content

TraitObligation

Type Alias TraitObligation 

Source
pub(crate) type TraitObligation<'db> = Obligation<'db, TraitPredicate<'db>>;

Aliased Type§

pub(crate) struct TraitObligation<'db> {
    pub cause: ObligationCause,
    pub param_env: ParamEnv<'db>,
    pub predicate: TraitPredicate<DbInterner<'db>>,
    pub recursion_depth: usize,
}

Fields§

§cause: ObligationCause

The reason we have to prove this thing.

§param_env: ParamEnv<'db>

The environment in which we should prove this thing.

§predicate: TraitPredicate<DbInterner<'db>>

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.