Skip to main content

Module fast_path

Module fast_path 

Source
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§

RerunStalled 🔒

Functions§

compute_goal_fast_path
This is a fast path optimization: See the docs on ComputeGoalFastPathOutcome
compute_goal_fast_path_cold 🔒
compute_goal_fast_path is complicated enough that outling helps, so it gets optimized separately from the caller. compute_goal_fast_path is 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