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

Modules§

alias_relate 🔒
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.
effect_goals 🔒
Dealing with host effect goals, i.e. enforcing the constness in T: const Trait or T: ~const Trait.
eval_ctxt 🔒
inspect
normalizes_to 🔒
project_goals 🔒
search_graph 🔒
trait_goals 🔒
Dealing with trait goals, i.e. T: Trait<'a, U>.

Structs§

EvalCtxt
ExternalConstraintsData
Additional constraints returned on success.
Goal
A goal is a statement, i.e. predicate, we want to prove given some assumptions, i.e. param_env.
NestedNormalizationGoals
NoSolution
PredefinedOpaquesData
Opaques that are defined in the inference context before a query is called.
QueryInput
Response

Enums§

AdtDestructorKind
Indicates that a impl Drop for Adt is const or not.
BuiltinImplSource
CandidateSource
Possible ways the given goal can be proven.
Certainty
GenerateProofTree
GoalEvaluationKind 🔒
GoalSource
Why a specific goal has to be proven.
HasChanged
Whether evaluating this goal ended up changing the inference state.
MaybeCause
Why we failed to evaluate a goal.

Constants§

FIXPOINT_STEP_LIMIT 🔒
How many fixpoint iterations we should attempt inside of the solver before bailing with overflow.

Traits§

SolverDelegateEvalExt

Functions§

has_no_inference_or_external_constraints 🔒
response_no_constraints_raw 🔒

Type Aliases§

CanonicalInput
CanonicalResponse
QueryResult
The result of evaluating a canonical query.