Module rustc_next_trait_solver::solve
source · Expand description
The next-generation trait solver, currently still WIP.
As a user of rust, you can use -Znext-solver
to enable the new trait solver.
As a developer of rustc, you shouldn’t be using the new trait
solver without asking the trait-system-refactor-initiative, but it can
be enabled with InferCtxtBuilder::with_next_trait_solver
. This will
ensure that trait solving using that inference context will be routed
to the new trait solver.
For a high-level overview of how this solver works, check out the relevant section of the rustc-dev-guide.
FIXME(@lcnr): Write that section. If you read this before then ask me about it on zulip.
Modules§
- Implements the
AliasRelate
goal, which is used when unifying aliases. Doing this via a separate goal is called “deferred alias relation” and part of our more general approach to “lazy normalization”. - assembly 🔒Code shared by trait and projection goals for candidate assembly.
- Dealing with trait goals, i.e.
T: Trait<'a, U>
.
Structs§
- Additional constraints returned on success.
- A goal is a statement, i.e.
predicate
, we want to prove given some assumptions, i.e.param_env
. - Opaques that are defined in the inference context before a query is called.
Enums§
- Possible ways the given goal can be proven.
- Why a specific goal has to be proven.
- Why we failed to evaluate a goal.
- Depending on the stage of compilation, we want projection to be more or less conservative.
Constants§
- How many fixpoint iterations we should attempt inside of the solver before bailing with overflow.
Traits§
Functions§
Type Aliases§
- The result of evaluating a canonical query.