Skip to content
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

Add -Ztrait-solver=next-coherence #112122

Merged
merged 4 commits into from
Jun 7, 2023
Merged

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented May 31, 2023

Flag that conditionally uses the trait solver only during coherence, for more testing and/or eventual partial-migration onto the trait solver (in the medium- to long-term).

  • This still uses the selection context in some of the coherence methods I think, so it's not "complete". Putting this up for review and/or for further work in-tree.
  • I probably need to spend a bit more time making sure that we don't sneakily create any other infcx's during coherence that also need the new solver enabled.

r? @lcnr

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 31, 2023
@rustbot
Copy link
Collaborator

rustbot commented May 31, 2023

Some changes occurred in engine.rs, potentially modifying the public API of ObligationCtxt.

cc @lcnr, @compiler-errors

@compiler-errors
Copy link
Member Author

cc @rust-lang/initiative-trait-system-refactor bc of a lack of auto-ping

@compiler-errors compiler-errors added the WG-trait-system-refactor The Rustc Trait System Refactor Initiative label May 31, 2023
@BoxyUwU
Copy link
Member

BoxyUwU commented May 31, 2023

Why do we need a bool on InferCtxt instead of deriving that information from the flag + whether intercrate mode is set

@compiler-errors
Copy link
Member Author

I had originally wanted to make it configurable independently of intercrate mode, but yeah, currently it doesn't need to be a separate bool.

@lcnr
Copy link
Contributor

lcnr commented May 31, 2023

I had originally wanted to make it configurable independently of intercrate mode, but yeah, currently it doesn't need to be a separate bool.

I think that's valuable, would also expect us to e.g. move wf check and mir typeck to the new solver separately from typeck

Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vibe: can you change use_next_trait_solver to next_trait_solver? idk, use feels somewhat redundant to me and makes stuff harder to read imo

after nits r=me

compiler/rustc_infer/src/infer/mod.rs Outdated Show resolved Hide resolved
compiler/rustc_trait_selection/src/traits/engine.rs Outdated Show resolved Hide resolved
@lcnr lcnr added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 6, 2023
@rustbot
Copy link
Collaborator

rustbot commented Jun 6, 2023

Some changes occurred to the core trait solver

cc @rust-lang/initiative-trait-system-refactor

@compiler-errors
Copy link
Member Author

@bors r=lcnr

@bors
Copy link
Contributor

bors commented Jun 6, 2023

📌 Commit aabdeed has been approved by lcnr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 6, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 7, 2023
Rollup of 6 pull requests

Successful merges:

 - rust-lang#112076 (Fall back to bidirectional normalizes-to if no subst-relate candidate in alias-relate goal)
 - rust-lang#112122 (Add `-Ztrait-solver=next-coherence`)
 - rust-lang#112251 (rustdoc: convert `if let Some()` that always matches to variable)
 - rust-lang#112345 (fix(expand): prevent infinity loop in macro containing only "///")
 - rust-lang#112359 (Respect `RUST_BACKTRACE` for delayed bugs)
 - rust-lang#112382 (download-rustc: Fix `x test core` on MacOS)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 0b002eb into rust-lang:master Jun 7, 2023
11 checks passed
@rustbot rustbot added this to the 1.72.0 milestone Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants