Module rustc_trait_selection::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.



Type Aliases§