Skip to content

session: Enable next-solver globally for assumptions-on-binders - #160513

Merged
rust-bors[bot] merged 4 commits into
rust-lang:mainfrom
Dnreikronos:assumptions_on_binders/enable_next_solver
Aug 7, 2026
Merged

rust-bors[bot] merged 4 commits into
rust-lang:mainfrom
Dnreikronos:assumptions_on_binders/enable_next_solver

Conversation

@Dnreikronos

@Dnreikronos Dnreikronos commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Zulip: https://rust-lang.zulipchat.com/#narrow/channel/618216-t-types.2Fcall-for-participation/topic/assumptions.20on.20binders.3A.20enable.20next-solver.20automatically/with/614548133

-Zassumptions-on-binders already needs the next trait solver, but you still had to pass -Znext-solver by hand. Easy to forget, and some spots (feature gates) read next_solver.globally directly, so just special-casing next_trait_solver_globally() wouldn't cut it.

After -Z parsing, if assumptions-on-binders is on, force NextSolverConfig { coherence: true, globally: true }. Same pattern as -Zretpoline-external-thunk. Flag order doesn't matter. -Znext-solver=no gets overridden too; imo that's the right call since the assumptions code can't run on the old solver. A hard conflict error would also be fine, just more annoying for day-to-day hacking.

Covered the flag alone, both orderings, and =no in a unit test. Dropped the explicit -Znext-solver from one UI test under assumptions_on_binders.

btw idk if we should strip -Znext-solver from the rest of that folder asap or leave the redundancy. irl I'd leave it for now. fyi this also means anything checking next_solver.globally sees the effective config. ltm if you'd rather go the conflict-error route instead of overriding =no.

Normalize next_solver after -Z parsing so flag order does not matter
and direct readers of next_solver.globally see the effective config.
Cover the flag alone, both orderings with -Znext-solver, override of
-Znext-solver=no, and a UI test that no longer passes -Znext-solver.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 4, 2026
@rustbot

rustbot commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

r? @chenyukang

rustbot has assigned @chenyukang.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 75 candidates
  • Random selection from 20 candidates

@Dnreikronos
Dnreikronos marked this pull request as draft August 4, 2026 15:43
@rustbot rustbot 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 Aug 4, 2026
@Dnreikronos
Dnreikronos force-pushed the assumptions_on_binders/enable_next_solver branch from 943cc32 to 57722cb Compare August 4, 2026 15:50
@Dnreikronos
Dnreikronos marked this pull request as ready for review August 4, 2026 17:07
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 4, 2026
@chenyukang

Copy link
Copy Markdown
Member

lgtm, but it's better r? @lcnr take a look.

@rustbot rustbot assigned lcnr and unassigned chenyukang Aug 5, 2026

@bit-aloo bit-aloo left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Few questions and suggestions. Rest looks good to me.

View changes since this review

@@ -1,4 +1,4 @@
//@ compile-flags: -Znext-solver -Zassumptions-on-binders
//@ compile-flags: -Zassumptions-on-binders

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We can remove the -Znext-solver from other tests in assumptions_on_binders.

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.

Yep, done. Cleared -Znext-solver / -Znext-solver=globally off the other six tests in that folder. They're redundant once -Zassumptions-on-binders turns the next solver on globally.

Comment on lines +2693 to +2695
if unstable_opts.assumptions_on_binders {
unstable_opts.next_solver = NextSolverConfig { coherence: true, globally: true };
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we add a warning in case if a user adds -Znext-solver=no and -Zassumptions-on-binders, saying using -Zassumption-on-binders unconditionally enables next solver?

@Dnreikronos Dnreikronos Aug 5, 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.

Yep. Overriding an explicit -Znext-solver=no without saying anything felt too sneaky, so I added an early warning instead of a hard error:

-Zassumptions-on-binders unconditionally enables the next trait solver; `-Znext-solver=no` is ignored

We only warn when next_solver.coherence is false, which is the =no case. UI test is next-solver-no-overridden.rs.

-Zassumptions-on-binders already forces the next solver globally, so
the explicit -Znext-solver flags in these sibling tests do nothing.
-Zassumptions-on-binders still forces the next solver globally, but an
explicit -Znext-solver=no is surprising to discard silently. Emit an
early warning in that case, matching the staticlib-hide-internal-symbols
precedent for conflicting -Z combos.
@Dnreikronos
Dnreikronos requested a review from bit-aloo August 5, 2026 16:54

@bit-aloo bit-aloo left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@lcnr

lcnr commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@bors r=lcnr,bit-aloo

@rust-bors

rust-bors Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 4f4ef37 has been approved by lcnr,bit-aloo

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-review Status: Awaiting review from the assignee but also interested parties. labels Aug 6, 2026
@lcnr

lcnr commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@bors rollup=never

@makai410

makai410 commented Aug 6, 2026

Copy link
Copy Markdown
Member

I suppose this should fix #160256 ?

@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors p=6
Scheduling

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 6, 2026
…t_solver, r=lcnr,bit-aloo

session: Enable next-solver globally for assumptions-on-binders

Zulip: https://rust-lang.zulipchat.com/#narrow/channel/618216-t-types.2Fcall-for-participation/topic/assumptions.20on.20binders.3A.20enable.20next-solver.20automatically/with/614548133

`-Zassumptions-on-binders` already needs the next trait solver, but you still had to pass `-Znext-solver` by hand. Easy to forget, and some spots (feature gates) read `next_solver.globally` directly, so just special-casing `next_trait_solver_globally()` wouldn't cut it.

After `-Z` parsing, if assumptions-on-binders is on, force `NextSolverConfig { coherence: true, globally: true }`. Same pattern as `-Zretpoline-external-thunk`. Flag order doesn't matter. `-Znext-solver=no` gets overridden too; imo that's the right call since the assumptions code can't run on the old solver. A hard conflict error would also be fine, just more annoying for day-to-day hacking.

Covered the flag alone, both orderings, and `=no` in a unit test. Dropped the explicit `-Znext-solver` from one UI test under `assumptions_on_binders`.

btw idk if we should strip `-Znext-solver` from the rest of that folder asap or leave the redundancy. irl I'd leave it for now. fyi this also means anything checking `next_solver.globally` sees the effective config. ltm if you'd rather go the conflict-error route instead of overriding `=no`.
@JonathanBrouwer

JonathanBrouwer commented Aug 6, 2026 •

Copy link
Copy Markdown
Member

@bors cancel
A few jobs already failed spuriously, bors just isn't detecting them

@rust-bors

rust-bors Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #160513.

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 6, 2026
…t_solver, r=lcnr,bit-aloo

session: Enable next-solver globally for assumptions-on-binders

Zulip: https://rust-lang.zulipchat.com/#narrow/channel/618216-t-types.2Fcall-for-participation/topic/assumptions.20on.20binders.3A.20enable.20next-solver.20automatically/with/614548133

`-Zassumptions-on-binders` already needs the next trait solver, but you still had to pass `-Znext-solver` by hand. Easy to forget, and some spots (feature gates) read `next_solver.globally` directly, so just special-casing `next_trait_solver_globally()` wouldn't cut it.

After `-Z` parsing, if assumptions-on-binders is on, force `NextSolverConfig { coherence: true, globally: true }`. Same pattern as `-Zretpoline-external-thunk`. Flag order doesn't matter. `-Znext-solver=no` gets overridden too; imo that's the right call since the assumptions code can't run on the old solver. A hard conflict error would also be fine, just more annoying for day-to-day hacking.

Covered the flag alone, both orderings, and `=no` in a unit test. Dropped the explicit `-Znext-solver` from one UI test under `assumptions_on_binders`.

btw idk if we should strip `-Znext-solver` from the rest of that folder asap or leave the redundancy. irl I'd leave it for now. fyi this also means anything checking `next_solver.globally` sees the effective config. ltm if you'd rather go the conflict-error route instead of overriding `=no`.
@jhpratt

jhpratt commented Aug 7, 2026

Copy link
Copy Markdown
Member

Looks like this failed to start.

@bors yield

@rust-bors

rust-bors Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #160513.

@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 7, 2026
@rust-bors

rust-bors Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: lcnr,bit-aloo
Duration: 3h 4m 47s
Pushing 88f7399 to main...

@rust-bors
rust-bors Bot merged commit 88f7399 into rust-lang:main Aug 7, 2026
14 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor
What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 84b36a7 (parent) -> 88f7399 (this PR)

Test differences

Show 7 test diffs

Stage 0

  • tests::test_assumptions_on_binders_enables_next_solver_globally: [missing] -> pass (J1)

Stage 1

  • [ui (polonius)] tests/ui/assumptions_on_binders/next-solver-no-overridden.rs: [missing] -> pass (J2)
  • tests::test_assumptions_on_binders_enables_next_solver_globally: [missing] -> pass (J3)
  • [ui] tests/ui/assumptions_on_binders/next-solver-no-overridden.rs: [missing] -> pass (J4)

Stage 2

  • [ui] tests/ui/assumptions_on_binders/next-solver-no-overridden.rs: [missing] -> pass (J0)

Additionally, 2 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 88f7399cb4912680976e1c342ea7661b9dc84940 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. x86_64-gnu-llvm-21-1: 38m 35s -> 59m 57s (+55.4%)
  2. x86_64-gnu-llvm-22-1: 52m 23s -> 1h 14m (+42.9%)
  3. dist-various-1: 33m -> 45m 30s (+37.8%)
  4. x86_64-msvc-1: 1h 56m -> 2h 38m (+37.0%)
  5. x86_64-msvc-ext1: 1h 41m -> 2h 17m (+35.7%)
  6. x86_64-gnu-stable: 1h 57m -> 2h 34m (+32.2%)
  7. dist-aarch64-apple: 2h 9m -> 1h 28m (-31.9%)
  8. dist-i686-linux: 1h 21m -> 1h 47m (+31.7%)
  9. optional-x86_64-gnu-autodiff: 57m 9s -> 41m 43s (-27.0%)
  10. dist-powerpc64-linux-gnu: 1h 31m -> 1h 7m (-26.2%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (88f7399): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.6% [-0.7%, -0.5%] 3
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -3.6%, secondary -6.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.6% [-4.7%, -2.6%] 2
Improvements ✅
(secondary)
-6.3% [-6.3%, -6.3%] 1
All ❌✅ (primary) -3.6% [-4.7%, -2.6%] 2

Cycles

Results (secondary 17.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
17.3% [3.0%, 24.7%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 457.798s -> 460.09s (0.50%)
Artifact size: 399.35 MiB -> 398.62 MiB (-0.18%)

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

Labels

merged-by-bors This PR was explicitly merged by bors. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants