Expand description
This file contains a number of standalone functions useful for taking fast paths in the trait
solver. The exact place where we check for these fast paths changes, and matters a lot for
performance. Ideally we’d only check them in evaluate_goal, but when evaluating root goals
we can check them earlier and save some time creating an EvalCtxt in the first place.
For debugging, fast paths can be disabled using -Zdisable-fast-paths.
Enums§
Functions§
- compute_
goal_ fast_ path - This is a fast path optimization:
See the docs on
ComputeGoalFastPathOutcome - compute_
goal_ 🔒fast_ path_ cold compute_goal_fast_pathis complicated enough that outling helps, so it gets optimized separately from the caller.compute_goal_fast_pathis the inlined version, and most call sites (when adding goals) use it. However, when entering the root we also want to check the fast path, and there the outlining matters.- rerunning_
stalled_ 🔒goal_ may_ make_ progress - If we have run a goal before, and it was stalled, check that any of the goal’s args have changed. This is a cheap way to determine that if we were to rerun this goal now, it will remain stalled since it’ll canonicalize the same way and evaluation is pure. Therefore, we can skip this rerun