Skip to content

Conversation

@BoxyUwU
Copy link
Member

@BoxyUwU BoxyUwU commented Nov 20, 2025

r? oli-obk

tracking issue: #132980

This PR requires that when feature(min_generic_const_args) is enabled, anon const const args are syntactically distinguishable from other kinds of args. We use const { ... } in const argument position to denote an anon const:

#![feature(min_generic_const_args)]

// no longer allowed as `1 + 1` is represented via an anon const and
// there is no syntactic marker
type Foo = [(); 1 + 1];

// allowed, `const { ... }` indicates an anon const representation
type Foo = [(); const { 1 + 1 }];

This restriction is only placed when mgca is enabled. There should be no effect on stable. This restriction is not enforced for unbraced literals which we continue to implicitly wrap in an anon const: tests/ui/const-generics/mgca/explicit_anon_consts_literals_hack.rs

This restriction allows us to create DefIds for anon consts only when actually required. When it is syntactically ambiguous whether a const argument is an anon const or not we are forced to conservatively create a DefId for every const argument even if it doesn't wind up needing one.

This works fine on stable but under mgca we can wind up with anon consts nested inside non-anon-const const arguments resulting in a broken DefId tree. See #148838 where an anon const arg inside of a path arg winds up with a parent of a conservatively created DefId that doesn't actually correspond to an anon const, resulting in an ICE.

With #149114 every field initialiser in a const argument would become a place where there could possibly be an anon const. This would also get worse once we support tuple constructors- now every function argument is a place where there could possibly be an anon const.

We introduce this restriction to avoid creating massive amounts of unused DefIds that make the parent tree significantly more complicated, and to avoid having to paper over this issue in things like generics_of.

Fixes #148838

It also must be syntactically clear from context whether '_ means an inference lifetime or an elided lifetime parameter. This restriction will allow us to properly resolve '_ in const arguments in mgca. This PR doesn't actually fix handle this, but we could do so trivially after this lands.

@rustbot
Copy link
Collaborator

rustbot commented Nov 20, 2025

Some changes occurred in compiler/rustc_builtin_macros/src/autodiff.rs

cc @ZuseZ4

@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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Nov 20, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 20, 2025

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

@rust-log-analyzer

This comment has been minimized.

@BoxyUwU BoxyUwU force-pushed the mgca_explicit_anon_consts branch 2 times, most recently from a786e30 to 09d75e3 Compare November 21, 2025 01:38
@rust-log-analyzer

This comment has been minimized.

@BoxyUwU BoxyUwU force-pushed the mgca_explicit_anon_consts branch from 09d75e3 to 5c64af2 Compare November 21, 2025 03:53
@rustbot
Copy link
Collaborator

rustbot commented Nov 21, 2025

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@rustbot rustbot added the T-clippy Relevant to the Clippy team. label Nov 21, 2025
@bors
Copy link
Collaborator

bors commented Nov 27, 2025

☔ The latest upstream changes (presumably #149387) made this pull request unmergeable. Please resolve the merge conflicts.

@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 Dec 9, 2025
@BoxyUwU BoxyUwU force-pushed the mgca_explicit_anon_consts branch from 5c64af2 to 8f74277 Compare December 10, 2025 07:46
@rustbot

This comment has been minimized.

@BoxyUwU BoxyUwU removed the T-clippy Relevant to the Clippy team. label Dec 10, 2025
@oli-obk
Copy link
Contributor

oli-obk commented Dec 10, 2025

r=me with commits cleaned up

@BoxyUwU BoxyUwU force-pushed the mgca_explicit_anon_consts branch from 8f74277 to 0c86a41 Compare December 10, 2025 16:25
@BoxyUwU
Copy link
Member Author

BoxyUwU commented Dec 10, 2025

@bors r=oli-obk rollup=never

@bors
Copy link
Collaborator

bors commented Dec 10, 2025

📌 Commit 0c86a41 has been approved by oli-obk

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Dec 10, 2025
@bors bors added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 11, 2025
@BoxyUwU
Copy link
Member Author

BoxyUwU commented Dec 11, 2025

@bors r=oli-obk

@bors
Copy link
Collaborator

bors commented Dec 11, 2025

💡 This pull request was already approved, no need to approve it again.

  • This pull request previously failed. You should add more commits to fix the bug, or use retry to trigger a build again.
  • There's another pull request that is currently being tested, blocking this pull request: bump bootstrap compiler to 1.93 beta #149831

@bors
Copy link
Collaborator

bors commented Dec 11, 2025

📌 Commit 0c86a41 has been approved by oli-obk

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 Dec 11, 2025
@bors
Copy link
Collaborator

bors commented Dec 12, 2025

☔ The latest upstream changes (presumably #148477) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors 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 Dec 12, 2025
@BoxyUwU BoxyUwU force-pushed the mgca_explicit_anon_consts branch from 0c86a41 to acc3a0e Compare December 12, 2025 15:51
@rustbot
Copy link
Collaborator

rustbot commented Dec 12, 2025

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.

@BoxyUwU
Copy link
Member Author

BoxyUwU commented Dec 12, 2025

@bors r=oli-obk

@bors
Copy link
Collaborator

bors commented Dec 12, 2025

📌 Commit acc3a0e has been approved by oli-obk

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 Dec 12, 2025
@BoxyUwU
Copy link
Member Author

BoxyUwU commented Dec 12, 2025

@bors r-

actually should wait for CI to pass given rebase

@bors bors 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 Dec 12, 2025
@BoxyUwU
Copy link
Member Author

BoxyUwU commented Dec 12, 2025

@bors r=oli-obk

@bors
Copy link
Collaborator

bors commented Dec 12, 2025

📌 Commit acc3a0e has been approved by oli-obk

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 Dec 12, 2025
@bors
Copy link
Collaborator

bors commented Dec 12, 2025

⌛ Testing commit acc3a0e with merge dc47a69...

@bors
Copy link
Collaborator

bors commented Dec 13, 2025

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing dc47a69 to main...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 13, 2025
@bors bors merged commit dc47a69 into rust-lang:main Dec 13, 2025
12 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Dec 13, 2025
@github-actions
Copy link
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 fa5eda1 (parent) -> dc47a69 (this PR)

Test differences

Show 56 test diffs

Stage 1

  • [ui] tests/ui/associated-type-bounds/const-projection-err.rs: [missing] -> pass (J1)
  • [ui] tests/ui/associated-type-bounds/const-projection-err.rs#gce: pass -> [missing] (J1)
  • [ui] tests/ui/associated-type-bounds/const-projection-err.rs#stock: pass -> [missing] (J1)
  • [ui] tests/ui/const-generics/mgca/explicit_anon_consts.rs: [missing] -> pass (J1)
  • [ui] tests/ui/const-generics/mgca/explicit_anon_consts_literals_hack.rs: [missing] -> pass (J1)
  • [ui] tests/ui/const-generics/mgca/multi_braced_direct_const_args.rs: [missing] -> pass (J1)
  • [ui] tests/ui/const-generics/mgca/unbraced_const_block_const_arg_gated.rs: [missing] -> pass (J1)

Stage 2

  • [ui] tests/ui/associated-type-bounds/const-projection-err.rs: [missing] -> pass (J0)
  • [ui] tests/ui/associated-type-bounds/const-projection-err.rs#gce: pass -> [missing] (J0)
  • [ui] tests/ui/associated-type-bounds/const-projection-err.rs#stock: pass -> [missing] (J0)
  • [ui] tests/ui/const-generics/mgca/explicit_anon_consts.rs: [missing] -> pass (J0)
  • [ui] tests/ui/const-generics/mgca/explicit_anon_consts_literals_hack.rs: [missing] -> pass (J0)
  • [ui] tests/ui/const-generics/mgca/multi_braced_direct_const_args.rs: [missing] -> pass (J0)
  • [ui] tests/ui/const-generics/mgca/unbraced_const_block_const_arg_gated.rs: [missing] -> pass (J0)

Additionally, 42 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 dc47a69ed94bc88b10b7d500cceacf29b87bcbbe --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: 3238.0s -> 3753.9s (+15.9%)
  2. aarch64-gnu-llvm-20-2: 2251.0s -> 2580.7s (+14.6%)
  3. aarch64-gnu-llvm-20-1: 3378.5s -> 3871.9s (+14.6%)
  4. pr-check-1: 1704.8s -> 1944.8s (+14.1%)
  5. x86_64-gnu-gcc: 3135.0s -> 3539.2s (+12.9%)
  6. dist-x86_64-apple: 7034.7s -> 7918.2s (+12.6%)
  7. test-various: 6532.0s -> 7318.2s (+12.0%)
  8. x86_64-rust-for-linux: 2870.8s -> 3208.8s (+11.8%)
  9. dist-apple-various: 4078.6s -> 3617.3s (-11.3%)
  10. dist-aarch64-llvm-mingw: 6546.5s -> 5988.1s (-8.5%)
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
Collaborator

Finished benchmarking commit (dc47a69): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (secondary 0.8%)

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.8% [0.8%, 0.9%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results (secondary -4.0%)

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)
- - 0
Improvements ✅
(secondary)
-4.0% [-4.0%, -4.0%] 1
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 473.976s -> 475.622s (0.35%)
Artifact size: 389.30 MiB -> 389.31 MiB (0.00%)

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. 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ICE: generics_of: unexpected node kind ConstArg(ConstArg

6 participants