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
- format 🔒
- A self-contained computation during trait solving. This either corresponds to a
EvalCtxt::probe(_X)call or the root evaluation of a goal.
datatogether with information about how they relate to the input of the canonical query.
- When evaluating the root goals we also store the original values for the
CanonicalVarValuesof the canonicalized goal. We use this to map any CanonicalState from the local
InferCtxtof the solver query to the
InferCtxtof the caller.