-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement the skeleton of the updated trait solver #105661
Conversation
afa7c1e
to
491f0fb
Compare
This comment was marked as outdated.
This comment was marked as outdated.
0d7b5b5
to
84c9bb3
Compare
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool!
Other team members or initiative group members can and should leave reviews inline after this lands if they have the opportunty to read through this PR, but landing this now is very low risk because it's not hooked up to anything yet 😸
@bors r+ not compelled to put rollup=never b/c it's a big PR but doesn't really touch existing files, nor should we need to bisect here really. |
📌 Commit 89fb51a2a29cbb2a3fd5a8e8e4fc327f3ab7fc44 has been approved by It is now in the queue for this repository. |
⌛ Testing commit 89fb51a2a29cbb2a3fd5a8e8e4fc327f3ab7fc44 with merge c88a482905f2889192a86e9a8a31368d9c819547... |
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
@bors r=compiler-errors |
implement the skeleton of the updated trait solver cc `@rust-lang/initiative-trait-system-refactor` This is mostly following the architecture discussed in the types team meetup. After discussing the desired changes for the trait solver, we encountered cyclic dependencies between them. Most notably between changing evaluate to be canonical and returning inference constraints. We cannot canonicalize evaluate without returning inference constraints due to coinductive cycles. However, caching inference constraints also relies on canonicalization. Implementing both of these changes at once in-place is not feasible. This somewhat closely mirrors the current `evaluate` implementation with the following notable differences: - it moves `project` into the core solver, allowing us to correctly deal with coinductive projections (will be required for implied bounds, perfect derive) - it changes trait solver overflow to be non-fatal (required to backcompat breakage from changes to the iteration order of nested goals, deferred projection equality, generally very useful) - it returns inference constraints and canonicalizes inputs and outputs (required for a lot things, most notably merging fulfill and evaluate, and deferred projection equality) - it is implemented to work with lazy normalization A lot of things aren't yet implemented, but the remaining FIXMEs should all be fairly self-contained and parallelizable. If the architecture looks correct and is what we want here, I would like to quickly merge this and then split the work. r? `@compiler-errors` / `@rust-lang/types` :3
implement the skeleton of the updated trait solver cc ``@rust-lang/initiative-trait-system-refactor`` This is mostly following the architecture discussed in the types team meetup. After discussing the desired changes for the trait solver, we encountered cyclic dependencies between them. Most notably between changing evaluate to be canonical and returning inference constraints. We cannot canonicalize evaluate without returning inference constraints due to coinductive cycles. However, caching inference constraints also relies on canonicalization. Implementing both of these changes at once in-place is not feasible. This somewhat closely mirrors the current `evaluate` implementation with the following notable differences: - it moves `project` into the core solver, allowing us to correctly deal with coinductive projections (will be required for implied bounds, perfect derive) - it changes trait solver overflow to be non-fatal (required to backcompat breakage from changes to the iteration order of nested goals, deferred projection equality, generally very useful) - it returns inference constraints and canonicalizes inputs and outputs (required for a lot things, most notably merging fulfill and evaluate, and deferred projection equality) - it is implemented to work with lazy normalization A lot of things aren't yet implemented, but the remaining FIXMEs should all be fairly self-contained and parallelizable. If the architecture looks correct and is what we want here, I would like to quickly merge this and then split the work. r? ``@compiler-errors`` / ``@rust-lang/types`` :3
Rollup of 6 pull requests Successful merges: - rust-lang#105661 (implement the skeleton of the updated trait solver) - rust-lang#105853 (Make the pre-push script work on directories with spaces) - rust-lang#106043 (Move tests) - rust-lang#106048 (Run `tidy` in its own job in PR CI) - rust-lang#106055 (Check arg expressions properly on error in `confirm_builtin_call`) - rust-lang#106067 (A few metadata nits) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
cc @rust-lang/initiative-trait-system-refactor
This is mostly following the architecture discussed in the types team meetup.
After discussing the desired changes for the trait solver, we encountered cyclic dependencies between them. Most notably between changing evaluate to be canonical and returning inference constraints. We cannot canonicalize evaluate without returning inference constraints due to coinductive cycles. However, caching inference constraints also relies on canonicalization. Implementing both of these changes at once in-place is not feasible.
This somewhat closely mirrors the current
evaluate
implementation with the following notable differences:project
into the core solver, allowing us to correctly deal with coinductive projections (will be required for implied bounds, perfect derive)A lot of things aren't yet implemented, but the remaining FIXMEs should all be fairly self-contained and parallelizable. If the architecture looks correct and is what we want here, I would like to quickly merge this and then split the work.
r? @compiler-errors / @rust-lang/types :3