Skip to content

Conversation

fmease
Copy link
Member

@fmease fmease commented Sep 10, 2025

Important

If you're coming here from any beta backport nomination thread on Zulip, only the last commit is truly relevant (the first commit doesn't need to be backported, it only contains test modifications)!

Don't consider [ to start a bound, only consider [const] in its entirety to do so. This drastically reduces (but doesn't eliminate!) the chance of real breakages. Like const, ~const and async before, [const] unavoidably brings along theoretical breakages, see preexisting tests: macro-const-trait-bound-theoretical-regression.rs and macro-async-trait-bound-theoretical-regression.rs.

Side note: It's unfortunate that we have to do this but apart from the known fact that MBE hurts forward compatibility, the [const] syntax is simply a bit scuffed (also CC'ing #146122, section (3)).

Fixes [after beta backport] #146417.

  • 1st commit: Restore the original test intentions of several preexisting related tests that were unfortunately lost over time
  • 2nd commit: Actually address the regression

r? @oli-obk or anyone

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 10, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 10, 2025

oli-obk is not on the review rotation at the moment.
They may take a while to respond.

@fmease fmease added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Sep 10, 2025
@fmease fmease force-pushed the less-greedy-maybe-const-bounds branch 5 times, most recently from 8078dba to 6258316 Compare September 10, 2025 19:52
@fmease fmease marked this pull request as ready for review September 10, 2025 19:58
@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 Sep 10, 2025
@fmease fmease added the PG-const-traits Project group: Const traits label Sep 10, 2025
@fmease
Copy link
Member Author

fmease commented Sep 10, 2025

or @fee1-dead if you'd like :)

@fmease fmease force-pushed the less-greedy-maybe-const-bounds branch 2 times, most recently from 6025279 to d9981f8 Compare September 10, 2025 21:22
@fmease fmease force-pushed the less-greedy-maybe-const-bounds branch from d9981f8 to f5dad62 Compare September 10, 2025 21:24
@estebank
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 11, 2025

📌 Commit f5dad62 has been approved by estebank

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-review Status: Awaiting review from the assignee but also interested parties. labels Sep 11, 2025
bors added a commit that referenced this pull request Sep 11, 2025
Rollup of 11 pull requests

Successful merges:

 - #142315 (core::ptr: deduplicate docs for as_ref, addr, and as_uninit_ref)
 - #146335 (disable core dumps for panic-uninitialized-zeroed)
 - #146347 (report duplicate symbols added by the driver)
 - #146370 (Update the LoongArch target documentation)
 - #146379 (Fix `compare_against_sw_vers` test)
 - #146380 (Unify and deduplicate bits conv float tests)
 - #146415 (s390x: mark soft-float target feature as incompatible)
 - #146422 (Less greedily parse `[const]` bounds)
 - #146424 (Improve `core::ops` coverage)
 - #146425 (Improve `core::array` coverage)
 - #146428 (Revert `assert!` desugaring changes (#122661))

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Sep 11, 2025
Rollup of 11 pull requests

Successful merges:

 - #142315 (core::ptr: deduplicate docs for as_ref, addr, and as_uninit_ref)
 - #146335 (disable core dumps for panic-uninitialized-zeroed)
 - #146347 (report duplicate symbols added by the driver)
 - #146370 (Update the LoongArch target documentation)
 - #146379 (Fix `compare_against_sw_vers` test)
 - #146380 (Unify and deduplicate bits conv float tests)
 - #146415 (s390x: mark soft-float target feature as incompatible)
 - #146422 (Less greedily parse `[const]` bounds)
 - #146424 (Improve `core::ops` coverage)
 - #146425 (Improve `core::array` coverage)
 - #146428 (Revert `assert!` desugaring changes (#122661))

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit d037d10 into rust-lang:master Sep 11, 2025
10 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Sep 11, 2025
rust-timer added a commit that referenced this pull request Sep 11, 2025
Rollup merge of #146422 - fmease:less-greedy-maybe-const-bounds, r=estebank

Less greedily parse `[const]` bounds

> [!IMPORTANT]
> If you're coming here from any beta backport nomination thread on Zulip, only the last commit is truly relevant (the first commit doesn't need to be backported, it only contains test modifications)!

Don't consider `[` to start a bound, only consider `[const]` in its entirety to do so. This drastically reduces (but doesn't eliminate!) the chance of *real* breakages. Like `const`, `~const` and `async` before, `[const]` unavoidably brings along theoretical breakages, see preexisting tests: `macro-const-trait-bound-theoretical-regression.rs` and `macro-async-trait-bound-theoretical-regression.rs`.

Side note: It's unfortunate that we have to do this but apart from the known fact that MBE hurts forward compatibility, the `[const]` syntax is simply a bit scuffed (also CC'ing #146122, section (3)).

Fixes [after beta backport] #146417.

* 1st commit: Restore the original test intentions of several preexisting related tests that were unfortunately lost over time
  * I've added a bunch of SCREAMING comments to make it less likely to be lost again
  * CC PR #119099 which added most of these tests
  * CC [#144409 (comment)](#144409 (comment)) for further context (NB: It's not the only PR that negatively affected the test intention)
* 2nd commit: Actually address the regression

r? `@oli-obk` or anyone
@fmease fmease deleted the less-greedy-maybe-const-bounds branch September 11, 2025 12:48
@jieyouxu
Copy link
Member

This was discussed in today's compiler triage meeting #t-compiler/meetings > [weekly] 2025-09-11 @ 💬, beta backport is approved.

@rustbot label: +beta-accepted

@rustbot rustbot added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Sep 11, 2025
@fmease fmease removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Sep 11, 2025
@fmease fmease modified the milestones: 1.91.0, 1.90.0 Sep 11, 2025
bors added a commit that referenced this pull request Sep 11, 2025
…=fmease

[beta] Backport "Less greedily parse `[const]` bounds"

Backport of #146422.
Following https://forge.rust-lang.org/release/backporting.html#beta-backporting-in-rust-langrust.

Not part of some hypothetical future backport rollup because we're under time pressure as release procedures will commence very soon: https://forge.rust-lang.org/#current-release-versions, https://forge.rust-lang.org/release/process.html.

cc `@cuviper`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. PG-const-traits Project group: Const traits S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

6 participants