-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Less greedily parse [const]
bounds
#146422
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
8078dba
to
6258316
Compare
or @fee1-dead if you'd like :) |
6025279
to
d9981f8
Compare
d9981f8
to
f5dad62
Compare
@bors r+ |
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
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
This was discussed in today's compiler triage meeting #t-compiler/meetings > [weekly] 2025-09-11 @ 💬, beta backport is approved. @rustbot label: +beta-accepted |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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. Likeconst
,~const
andasync
before,[const]
unavoidably brings along theoretical breakages, see preexisting tests:macro-const-trait-bound-theoretical-regression.rs
andmacro-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.
const Trait
(always-const trait bounds) #119099 which added most of these testsr? @oli-obk or anyone