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§
Structs§
- Eval
Ctxt - External
Constraints Data - 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
. - Goal
Evaluation - The result of evaluating a goal.
- Goal
Stalled On - The conditions that must change for a goal to warrant
- Nested
Normalization Goals - NoSolution
- Query
Input - Response
Enums§
- AdtDestructor
Kind - Indicates that a
impl Drop for Adt
isconst
or not. - Builtin
Impl Source - Candidate
Source - Possible ways the given goal can be proven.
- Certainty
- Generate
Proof Tree - Goal
Source - Why a specific goal has to be proven.
- HasChanged
- Whether evaluating this goal ended up changing the inference state.
- Maybe
Cause - Why we failed to evaluate a goal.
- Opaque
Types Jank - Supporting not-yet-defined opaque types in HIR typeck is somewhat challenging. Ideally we’d normalize them to a new inference variable and just defer type inference which relies on the opaque until we’ve constrained the hidden type.
- Param
EnvSource - Sized
Trait Kind - Which sizedness trait -
Sized
,MetaSized
?PointeeSized
is omitted as it is removed during lowering.
Traits§
Functions§
- evaluate_
root_ goal_ for_ proof_ tree_ raw_ provider - Do not call this directly, use the
tcx
query instead.
Type Aliases§
- Canonical
Input - Canonical
Response - Query
Result - The result of evaluating a canonical query.