Skip to content

Rip out old solver coherence - #161491

Open
sjwang05 wants to merge 2 commits into
rust-lang:mainfrom
sjwang05:no-old-coherence
Open

sjwang05 wants to merge 2 commits into
rust-lang:mainfrom
sjwang05:no-old-coherence

Conversation

@sjwang05

@sjwang05 sjwang05 commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

View all comments

cc #t-types/call-for-participation > rip out old solver coherence support

Probably best reviewed commit-by-commit with ignore-whitespace.

#160668 replaced the last remaining place where old solver was still used by default in coherence with new solver. This PR removes code that was only used during coherence by the old solver, so now new-solver coherence is the only way to do coherence. So we don't confuse users, passing -Znext-solver=coherence and =no now do the exact same thing.

We also remove tracking intercrate ambiguity causes, since afaict the new solver uses a completely different path.

Everything else is either removing code that is now unreachable, or removing a condition that is now always true.

r? lcnr

@rustbot

rustbot commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in src/tools/compiletest

cc @jieyouxu

rustc-dev-guide is developed in its own repository. If possible, consider making this change to rust-lang/rustc-dev-guide instead.

cc @BoxyUwU, @tshepang

@rustbot rustbot added A-compiletest Area: The compiletest test runner A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Aug 22, 2026
selcx: &mut SelectionContext<'cx, 'tcx>,
#[instrument(level = "debug", skip(infcx), ret)]
fn impl_intersection_has_impossible_obligation<'a, 'tcx>(
infcx: &InferCtxt<'tcx>,

@sjwang05 sjwang05 Aug 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The selcx was only ever used with the old solver, hence we just pass the infcx directly now.

View changes since the review

@rustbot

rustbot commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

clippy is developed in its own repository. If possible, consider making this change to rust-lang/rust-clippy instead.

cc @rust-lang/clippy

miri is developed in its own repository. If the Miri part of this change can be broken out, consider making this change to rust-lang/miri instead. However, if Miri needs adjusting for rustc changes, just ignore this message.

cc @rust-lang/miri

@rustbot rustbot added the T-clippy Relevant to the Clippy team. label Aug 22, 2026
@rustbot

This comment has been minimized.

Comment thread compiler/rustc_session/src/options.rs Outdated
@rust-bors

This comment has been minimized.

Comment thread compiler/rustc_session/src/config.rs Outdated
Comment thread compiler/rustc_trait_selection/src/traits/select/mod.rs
@sjwang05
sjwang05 force-pushed the no-old-coherence branch 2 times, most recently from 2214e92 to 9f68a1b Compare August 26, 2026 08:08
@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot

This comment has been minimized.

Comment thread compiler/rustc_interface/src/tests.rs Outdated
Comment thread compiler/rustc_session/src/config.rs Outdated
Comment thread compiler/rustc_session/src/options.rs Outdated
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 3, 2026
Rip out old solver coherence

cc [#t-types/call-for-participation > rip out old solver coherence support](https://rust-lang.zulipchat.com/#narrow/channel/618216-t-types.2Fcall-for-participation/topic/rip.20out.20old.20solver.20coherence.20support/with/613938355)

Probably best reviewed commit-by-commit with ignore-whitespace.

rust-lang#160668 replaced the last remaining place where old solver was still used by default in coherence with new solver. This PR removes code that was only used during coherence by the old solver, so now new-solver coherence is the *only* way to do coherence. So we don't confuse users, passing `-Znext-solver=coherence` and `=no` now do the exact same thing.

We also remove tracking intercrate ambiguity causes, since afaict the new solver uses a completely different path.

Everything else is either removing code that is now unreachable, or removing a condition that is now always true.

r? lcnr
rust-bors Bot pushed a commit that referenced this pull request Oct 3, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #163645 (add `ignore-compare-mode-next-solver` to all next-solver tests)
 - #163663 (reflection: fix ICE when TypeId::info called on ADT)
 - #163454 (Improve suggestion for lifetime preceding type in generics)
 - #163561 (tests: accept noundef in a couple more places)
 - #163633 (core: io: clean `unused_variables` lint under `no_io_statics`)
 - #163681 (Make the tracking issue template better suited for experiments)
 - #163685 (Avoid long iterator chain in all_rust_features)
 - #163690 (refactor: migrate to LLVM-C's `LLVMGetOrInsertFunction`)

Failed merges:

 - #161491 (Rip out old solver coherence)
@rust-bors rust-bors Bot 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 3, 2026
@rust-bors

This comment has been minimized.

@khyperia

khyperia commented Oct 3, 2026

Copy link
Copy Markdown
Member

omg im so sorry, incredibly unfortunate merge conflicts. I've never used delegate+ before but hopefully it works for this? r=me when you've resolved the merge conflicts

@bors delegate+

@rust-bors

rust-bors Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

✌️ @sjwang05, you can now approve this pull request!

If @khyperia told you to "r=me" after making some further change, then please make that change and post @bors r=khyperia.

View changes since this delegation.

@rustbot

This comment has been minimized.

@sjwang05

sjwang05 commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

@bors r=khyperia

@rust-bors

rust-bors Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 46d0705 has been approved by khyperia

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Oct 3, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 4, 2026
Rollup of 18 pull requests

Successful merges:

 - #158102 (When compiling without a specified `--edition`, emit a message)
 - #162027 (std: add `fs::rename_noreplace`)
 - #162761 (Lower attributes for functions without bodies)
 - #163161 (implement FCW for `rustc_allowed_through_unstable_modules` items)
 - #163613 (Tweak the rendering of "not general enough" errors on the old trait solver)
 - #162062 (core: fix the docs of PanicInfo::location)
 - #163140 (document safety requirements for atomic intrinsics)
 - #163342 (Don't imply incorrect things about `Global` in the docs of `System`)
 - #163445 (Add safety comments for alloc::str)
 - #163503 (Mark Rc strong/weak count methods must_use)
 - #163548 (fs::set_permissions_nofollow: Android support, test cleanup)
 - #163585 ([triagebot] Create `debugger_visualizer` assign group)
 - #163597 (Add `SplitPathsRef` implementation for motor to make std build)
 - #163602 (Move media & home dirs tests to fs tests.)
 - #163667 (Finalize changes on expect messages for library/core/src/fmt/mod.rs)
 - #163682 ([rustdoc] Correctly link to (imported) enum variants with "jump to def")
 - #163683 (Fix GCC codegen backend comment in bootstrap)
 - #163703 (Move more `rustdoc-html tests` in the right location)

Failed merges:

 - #161491 (Rip out old solver coherence)
rust-bors Bot pushed a commit that referenced this pull request Oct 4, 2026
Rollup of 18 pull requests

Successful merges:

 - #158102 (When compiling without a specified `--edition`, emit a message)
 - #162761 (Lower attributes for functions without bodies)
 - #163161 (implement FCW for `rustc_allowed_through_unstable_modules` items)
 - #163613 (Tweak the rendering of "not general enough" errors on the old trait solver)
 - #162062 (core: fix the docs of PanicInfo::location)
 - #163140 (document safety requirements for atomic intrinsics)
 - #163342 (Don't imply incorrect things about `Global` in the docs of `System`)
 - #163445 (Add safety comments for alloc::str)
 - #163503 (Mark Rc strong/weak count methods must_use)
 - #163548 (fs::set_permissions_nofollow: Android support, test cleanup)
 - #163585 ([triagebot] Create `debugger_visualizer` assign group)
 - #163597 (Add `SplitPathsRef` implementation for motor to make std build)
 - #163602 (Move media & home dirs tests to fs tests.)
 - #163667 (Finalize changes on expect messages for library/core/src/fmt/mod.rs)
 - #163682 ([rustdoc] Correctly link to (imported) enum variants with "jump to def")
 - #163683 (Fix GCC codegen backend comment in bootstrap)
 - #163703 (Move more `rustdoc-html tests` in the right location)
 - #163725 (some crashes fixed with next-solver)

Failed merges:

 - #161491 (Rip out old solver coherence)
@rust-bors rust-bors Bot 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 4, 2026
@rust-bors

This comment has been minimized.

@rustbot

rustbot commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@sjwang05

sjwang05 commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@bors r=khyperia

this time, surely.

@rust-bors

rust-bors Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 3a7efa2 has been tentatively approved by khyperia

It will be put into the queue for this repository once PR CI succeeds.

@rust-bors rust-bors Bot 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 Oct 4, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiletest Area: The compiletest test runner A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool 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-clippy Relevant to the Clippy team. 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 (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants