| Age | Commit message (Collapse) | Author | Lines | |
|---|---|---|---|---|
| 2025-09-18 | move `mod canonical` out of `eval_ctxt` | lcnr | -2/+2 | |
| 2025-09-18 | support calls on opaque types :< | lcnr | -1/+1 | |
| 2025-08-29 | cleanup proof tree implementation and add cache | lcnr | -12/+6 | |
| 2025-06-26 | Auto merge of #142774 - lcnr:search_graph-2, r=oli-obk | bors | -6/+6 | |
| `evaluate_goal` avoid unnecessary step based on rust-lang/rust#142617. This does not mess with the debug logging for the trait solver and is a very nice cleanup for rust-lang/rust#142735. E.g. for ```rust #[derive(Clone)] struct Wrapper<T>(T); #[derive(Clone)] struct Nested; // using a separate type to avoid the fast paths fn is_clone<T: Clone>() {} fn main() { is_clone::<Wrapper<Nested>>(); } ``` We get the following proof tree with `RUSTC_LOG=rustc_type_ir::search_graph=debug,rustc_next_trait_solver=debug` ``` rustc_next_trait_solver::solve::eval_ctxt::evaluate_root_goal goal=Goal { param_env: ParamEnv { caller_bounds: [] }, predicate: Binder { value: TraitPredicate(<Wrapper<Nested> as std::clone::Clone>, polarity:Positive), bound_vars: [] } }, generate_proof_tree=No, span=src/main.rs:7:5: 7:34 (#0), stalled_on=None rustc_type_ir::search_graph::evaluate_goal input=CanonicalQueryInput { canonical: Canonical { value: QueryInput { goal: Goal { param_env: ParamEnv { caller_bounds: [] }, predicate: Binder { value: TraitPredicate(<Wrapper<Nested> as std::clone::Clone>, polarity:Positive), bound_vars: [] } }, predefined_opaques_in_body: PredefinedOpaques(PredefinedOpaquesData { opaque_types: [] }) }, max_universe: U0, variables: [] }, typing_mode: Analysis { defining_opaque_types_and_generators: [] } }, step_kind_from_parent=Unknown rustc_next_trait_solver::solve::eval_ctxt::probe::enter source=Impl(DefId(0:10 ~ main[21d2]::{impl#0})) rustc_next_trait_solver::solve::eval_ctxt::add_goal source=ImplWhereBound, goal=Goal { param_env: ParamEnv { caller_bounds: [] }, predicate: Binder { value: TraitPredicate(<_ as std::marker::Sized>, polarity:Positive), bound_vars: [] } } rustc_next_trait_solver::solve::eval_ctxt::add_goal source=ImplWhereBound, goal=Goal { param_env: ParamEnv { caller_bounds: [] }, predicate: Binder { value: TraitPredicate(<_ as std::clone::Clone>, polarity:Positive), bound_vars: [] } } rustc_type_ir::search_graph::evaluate_goal input=CanonicalQueryInput { canonical: Canonical { value: QueryInput { goal: Goal { param_env: ParamEnv { caller_bounds: [] }, predicate: Binder { value: TraitPredicate(<Nested as std::clone::Clone>, polarity:Positive), bound_vars: [] } }, predefined_opaques_in_body: PredefinedOpaques(PredefinedOpaquesData { opaque_types: [] }) }, max_universe: U0, variables: [] }, typing_mode: Analysis { defining_opaque_types_and_generators: [] } }, step_kind_from_parent=Unknown 0ms DEBUG rustc_type_ir::search_graph global cache hit, required_depth=0 0ms DEBUG rustc_type_ir::search_graph return=Ok(Canonical { value: Response { certainty: Yes, var_values: CanonicalVarValues { var_values: [] }, external_constraints: ExternalConstraints(ExternalConstraintsData { region_constraints: [], opaque_types: [], normalization_nested_goals: NestedNormalizationGoals([]) }) }, max_universe: U0, variables: [] }) rustc_next_trait_solver::solve::eval_ctxt::probe::enter source=BuiltinImpl(Misc) rustc_next_trait_solver::solve::trait_goals::merge_trait_candidates candidates=[Candidate { source: Impl(DefId(0:10 ~ main[21d2]::{impl#0})), result: Canonical { value: Response { certainty: Yes, var_values: CanonicalVarValues { var_values: [] }, external_constraints: ExternalConstraints(ExternalConstraintsData { region_constraints: [], opaque_types: [], normalization_nested_goals: NestedNormalizationGoals([]) }) }, max_universe: U0, variables: [] } }] 0ms DEBUG rustc_next_trait_solver::solve::trait_goals return=Ok((Canonical { value: Response { certainty: Yes, var_values: CanonicalVarValues { var_values: [] }, external_constraints: ExternalConstraints(ExternalConstraintsData { region_constraints: [], opaque_types: [], normalization_nested_goals: NestedNormalizationGoals([]) }) }, max_universe: U0, variables: [] }, Some(Misc))) 0ms DEBUG rustc_type_ir::search_graph insert global cache, evaluation_result=EvaluationResult { encountered_overflow: false, required_depth: 1, heads: CycleHeads { heads: {} }, nested_goals: NestedGoals { nested_goals: {} }, result: Ok(Canonical { value: Response { certainty: Yes, var_values: CanonicalVarValues { var_values: [] }, external_constraints: ExternalConstraints(ExternalConstraintsData { region_constraints: [], opaque_types: [], normalization_nested_goals: NestedNormalizationGoals([]) }) }, max_universe: U0, variables: [] }) } 0ms DEBUG rustc_type_ir::search_graph return=Ok(Canonical { value: Response { certainty: Yes, var_values: CanonicalVarValues { var_values: [] }, external_constraints: ExternalConstraints(ExternalConstraintsData { region_constraints: [], opaque_types: [], normalization_nested_goals: NestedNormalizationGoals([]) }) }, max_universe: U0, variables: [] }) ``` | ||||
| 2025-06-23 | Simplify API of solver a bit | Michael Goulet | -14/+6 | |
| 2025-06-23 | inspect: merge `[Canonical]GoalEvaluation` | lcnr | -6/+6 | |
| 2025-06-09 | Apply nested goals certainty to InspectGoals for normalizes-to | Michael Goulet | -35/+64 | |
| 2025-06-07 | Rollup merge of #142126 - compiler-errors:normalize-uv-via-relate, r=BoxyUwU | Guillaume Gomez | -4/+1 | |
| Treat normalizing consts like normalizing types in deeply normalize ...so that we don't end up putting a top-level normalizes-to goal in the fulfillment context, which ICEs. This basically just models the normalize-const code off of the normalize-ty code above it, which uses an alias-relate goal instead. Fixes rust-lang/rust#140571 r? lcnr | ||||
| 2025-06-07 | Unify normalization of terms in deeply normalize | Michael Goulet | -4/+1 | |
| 2025-06-05 | Only instantiate impl args | Michael Goulet | -28/+53 | |
| 2025-05-29 | Auto merge of #141581 - lcnr:fold-clauses, r=compiler-errors | bors | -5/+4 | |
| add additional `TypeFlags` fast paths Some crates, e.g. `diesel`, have items with a lot of where-clauses (more than 150). In these cases checking the `TypeFlags` of the whole `param_env` can be very beneficial. This adds `fn fold_clauses` to mirror the existing `fn visit_clauses` and then uses this in folders which fold `ParamEnv`s. Split out from rust-lang/rust#141451, depends on rust-lang/rust#141442. r? `@compiler-errors` | ||||
| 2025-05-27 | Rename unpack to kind | Michael Goulet | -1/+1 | |
| 2025-05-26 | add additional `TypeFlags` fast paths | lcnr | -5/+4 | |
| 2025-05-26 | Don't rerun goals if none of its vars have changed | Michael Goulet | -3/+4 | |
| 2025-05-07 | Use MaybeCause::or to allow constraints from overflows if they are combined ↵ | Michael Goulet | -1/+1 | |
| with ambiguity | ||||
| 2025-04-16 | Fix replacing supertrait aliases in ReplaceProjectionWith | Michael Goulet | -3/+5 | |
| 2025-03-15 | Fold visit into ty | Michael Goulet | -2/+1 | |
| 2025-02-19 | Make fewer crates depend on rustc_ast_ir | Michael Goulet | -2/+1 | |
| 2025-02-13 | normalizes-to rework rigid alias handling | lcnr | -2/+0 | |
| 2025-02-05 | Pass spans around new solver | Michael Goulet | -3/+6 | |
| 2025-01-31 | Manually walk into WF obligations in BestObligation proof tree visitor | Michael Goulet | -36/+46 | |
| 2024-10-22 | remove unused field | lcnr | -1/+1 | |
| 2024-10-15 | Be better at reporting alias errors | Michael Goulet | -2/+4 | |
| 2024-09-22 | Reformat using the new identifier sorting from rustfmt | Michael Goulet | -2/+2 | |
| 2024-08-30 | Remove `#[macro_use] extern crate tracing` from `rustc_trait_selection`. | Nicholas Nethercote | -0/+1 | |
| 2024-08-14 | Rollup merge of #128828 - lcnr:search-graph-11, r=compiler-errors | 许杰友 Jieyou Xu (Joe) | -7/+3 | |
| `-Znext-solver` caching This PR has two major changes while also fixing multiple issues found via fuzzing. The main optimization is the ability to not discard provisional cache entries when popping the highest cycle head the entry depends on. This fixes the hang in Fuchsia with `-Znext-solver=coherence`. It also bails if the result of a fixpoint iteration is ambiguous, even without reaching a fixpoint. This is necessary to avoid exponential blowup if a coinductive cycle results in ambiguity, e.g. due to unknowable candidates in coherence. Updating stack entries pretty much exclusively happens lazily now, so `fn check_invariants` ended up being mostly useless and I've removed it. See https://gist.github.com/lcnr/8de338fdb2685581e17727bbfab0622a for the invariants we would be able to assert with it. For a general overview, see the in-process update of the relevant rustc-dev-guide chapter: https://hackmd.io/1ALkSjKlSCyQG-dVb_PUHw r? ```@compiler-errors``` | ||||
| 2024-08-12 | do not use the global solver cache for proof trees | lcnr | -7/+3 | |
| doing so requires overwriting global cache entries and generally adds significant complexity to the solver. This is also only ever done for root goals, so it feels easier to wrap the `evaluate_canonical_goal` in an ordinary query if necessary. | ||||
| 2024-08-11 | Use assert_matches around the compiler | Michael Goulet | -2/+4 | |
| 2024-06-21 | Rename a bunch of things | Michael Goulet | -1/+1 | |
| 2024-06-18 | Fix impl for SolverDelegate | Michael Goulet | -38/+16 | |
| 2024-06-18 | Uplift the new trait solver | Michael Goulet | -580/+0 | |
| 2024-06-18 | SolverDelegate | Michael Goulet | -7/+11 | |
| 2024-06-15 | Rollup merge of #126404 - compiler-errors:alias-relate-terms, r=lcnr | Guillaume Gomez | -1/+14 | |
| Check that alias-relate terms are WF if reporting an error in alias-relate Check that each of the left/right term is WF when deriving a best error obligation for an alias-relate goal. This will make sure that given `<i32 as NotImplemented>::Assoc = ()` will drill down into `i32: NotImplemented` since we currently treat the projection as rigid. r? lcnr | ||||
| 2024-06-14 | Correctly consider depth when visiting WF goals | Michael Goulet | -1/+14 | |
| 2024-06-13 | Address nits | Michael Goulet | -3/+4 | |
| - Remove the ValuePairs glob import - Make DummyPairs -> ValuePairs::Dummy and make it bug more - Fix WC - Make interner return `impl IntoIterator`s | ||||
| 2024-06-12 | Walk into alias-eq nested goals even if normalization fails | Michael Goulet | -2/+5 | |
| 2024-06-05 | Basic removal of `Ty` from places (boring) | Boxy | -1/+1 | |
| 2024-05-28 | Make ProofTreeBuilder actually generic over interner | Michael Goulet | -59/+53 | |
| 2024-05-28 | refactor analyse visitor to instantiate states in order | lcnr | -45/+41 | |
| 2024-05-24 | remove proof tree formatter, make em shallow | lcnr | -167/+72 | |
| 2024-05-20 | Rework var resolution in InferCtxtLike, uplift EagerResolver | Michael Goulet | -1/+1 | |
| 2024-05-18 | Make proof tree building generic | Michael Goulet | -88/+102 | |
| 2024-05-18 | Uplift inspect into rustc_type_ir | Michael Goulet | -24/+25 | |
| 2024-05-13 | Use a proper probe for shadowing impl | Michael Goulet | -10/+24 | |
| 2024-05-13 | Remove `extern crate rustc_middle` from `rustc_trait_selection`. | Nicholas Nethercote | -0/+1 | |
| 2024-05-10 | Rollup merge of #124955 - nnethercote:next_ty_var, r=lcnr | Matthias Krüger | -11/+2 | |
| Use fewer origins when creating type variables. To reduce lots of repetitive boilerplate code. Details in the individual commit messages. r? ``@lcnr`` | ||||
| 2024-05-10 | Use fewer origins when creating type variables. | Nicholas Nethercote | -11/+2 | |
| `InferCtxt::next_{ty,const}_var*` all take an origin, but the `param_def_id` is almost always `None`. This commit changes them to just take a `Span` and build the origin within the method, and adds new methods for the rare cases where `param_def_id` might not be `None`. This avoids a lot of tedious origin building. Specifically: - next_ty_var{,_id_in_universe,_in_universe}: now take `Span` instead of `TypeVariableOrigin` - next_ty_var_with_origin: added - next_const_var{,_in_universe}: takes Span instead of ConstVariableOrigin - next_const_var_with_origin: added - next_region_var, next_region_var_in_universe: these are unchanged, still take RegionVariableOrigin The API inconsistency (ty/const vs region) seems worth it for the large conciseness improvements. | ||||
| 2024-05-09 | analyse visitor: build proof tree in probe | lcnr | -11/+33 | |
| 2024-05-07 | Rollup merge of #124827 - lcnr:generalize-incomplete, r=compiler-errors | Matthias Krüger | -1/+4 | |
| generalize hr alias: avoid unconstrainable infer vars fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/108 see inline comments for more details r? `@compiler-errors` cc `@BoxyUwU` | ||||
| 2024-05-07 | generalize hr alias: avoid unconstrainable infer vars | lcnr | -1/+4 | |
