Module rustc_infer::traits::solve::inspect
source · Expand description
Data structure used to inspect trait solver behavior.
During trait solving we optionally build “proof trees”, the root of which is a GoalEvaluation with GoalEvaluationKind::Root. These trees are used to improve the debug experience and are also used by the compiler itself to provide necessary context for error messages.
Because each nested goal in the solver gets canonicalized separately
and we discard inference progress via “probes”, we cannot mechanically
use proof trees without somehow “lifting up” data local to the current
InferCtxt
. Any data used mechanically is therefore canonicalized and
stored as CanonicalState. As printing canonicalized data worsens the
debugging dumps, we do not simply canonicalize everything.
This means proof trees contain inference variables and placeholders
local to a different InferCtxt
which must not be used with the
current one.
Structs
- A self-contained computation during trait solving. This either corresponds to a
EvalCtxt::probe(_X)
call or the root evaluation of a goal. - Some
data
together with information about how they relate to the input of the canonical query.
Enums
- When evaluating the root goals we also store the original values for the
CanonicalVarValues
of the canonicalized goal. We use this to map any CanonicalState from the localInferCtxt
of the solver query to theInferCtxt
of the caller. - What kind of probe we’re in. In case the probe represents a candidate, or the final result of the current goal - via ProbeKind::Root - we also store the QueryResult.