pub(crate) struct Table<I: Interner> {
    pub(crate) table_goal: UCanonical<InEnvironment<Goal<I>>>,
    pub(crate) coinductive_goal: bool,
    floundered: bool,
    answers: Vec<Answer<I>>,
    answers_hash: FxHashMap<Canonical<AnswerSubst<I>>, bool>,
    strands: VecDeque<Canonical<Strand<I>>>,
    pub(crate) answer_mode: AnswerMode,
}

Fields

table_goal: UCanonical<InEnvironment<Goal<I>>>

The goal this table is trying to solve (also the key to look it up).

coinductive_goal: bool

A goal is coinductive if it can assume itself to be true, more or less. This is true for auto traits.

floundered: bool

True if this table is floundered, meaning that it doesn’t have enough types specified for us to solve.

answers: Vec<Answer<I>>

Stores the answers that we have found thus far. When we get a request for an answer N, we will first check this vector.

answers_hash: FxHashMap<Canonical<AnswerSubst<I>>, bool>

An alternative storage for the answers we have so far, used to detect duplicates. Not every answer in answers will be represented here – we discard answers from answers_hash (but not answers) when better answers arrive (in particular, answers with no ambiguity).

FIXME – Ideally we would exclude the region constraints and delayed subgoals from the hash, but that’s a bit tricky to do with the current canonicalization setup. It should be ok not to do so though it can result in more answers than we need.

strands: VecDeque<Canonical<Strand<I>>>

Stores the active strands that we can “pull on” to find more answers.

answer_mode: AnswerMode

Implementations

Push a strand to the back of the queue of strands to be processed.

Remove the next strand from the queue that meets the given criteria

Mark the table as floundered – this also discards all pre-existing answers, as they are no longer relevant.

Returns true if the table is floundered.

Adds answer to our list of answers, unless it is already present.

Returns true if answer was added.

Panics

This will panic if a previous answer with the same substitution was marked as ambgiuous, but the new answer is not. No current tests trigger this case, and assumptions upstream assume that when true is returned here, that a new answer was added (instead of an) existing answer replaced.

Trait Implementations

Formats the value using the given formatter. Read more

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