struct AnswerSubstitutor<'t, I: Interner> {
    table: &'t mut InferenceTable<I>,
    environment: &'t Environment<I>,
    answer_subst: &'t Substitution<I>,
    outer_binder: DebruijnIndex,
    ex_clause: &'t mut ExClause<I>,
    interner: I,
    unification_database: &'t dyn UnificationDatabase<I>,
}

Fields

table: &'t mut InferenceTable<I>environment: &'t Environment<I>answer_subst: &'t Substitution<I>outer_binder: DebruijnIndex

Tracks the debrujn index of the first binder that is outside the term we are traversing. This starts as DebruijnIndex::INNERMOST, since we have not yet traversed any binders, but when we visit the inside of a binder, it would be incremented.

Example: If we are visiting (for<type> A, B, C, for<type> for<type> D), then this would be:

  • 1, when visiting A,
  • 0, when visiting B and C,
  • 2, when visiting D.
ex_clause: &'t mut ExClause<I>interner: Iunification_database: &'t dyn UnificationDatabase<I>

Implementations

When we encounter a variable in the answer goal, we first try unify_free_answer_var. Assuming that this fails, the variable must be a bound variable in the answer goal – in that case, there should be a corresponding bound variable in the pending goal. This bit of code just checks that latter case.

Trait Implementations

Indicates that the two types a and b were found in matching spots.

Indicates that the two lifetimes a and b were found in matching spots.

Indicates that the two consts a and b were found in matching spots.

Zips two values appearing beneath binders.

Retrieves the interner from the underlying zipper object

Retrieves the UnificationDatabase from the underlying zipper object

Zips two substs

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Cast a value to type U using CastTo.

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more