Skip to content

yeet type const - #162517

Merged
rust-bors[bot] merged 5 commits into
rust-lang:mainfrom
khyperia:yeet-type-const
Sep 12, 2026
Merged

rust-bors[bot] merged 5 commits into
rust-lang:mainfrom
khyperia:yeet-type-const

Conversation

@khyperia

@khyperia khyperia commented Sep 9, 2026

Copy link
Copy Markdown
Member

View all comments

tracking issue: #132980

zulip thread context (design decussion of future of gca): #project-const-generics > talkies at last @ 💬

this PR does two things:

it also migrates the test suite to the syntax introduced in #162179 i.e. the new way to write type const is now const ITEM: T = core::direct_const_arg!(V); (ouch my hands, that took a while)

r? @BoxyUwU

@rustbot

rustbot commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

This PR changes rustc_public

cc @oli-obk, @celinval, @ouz-a, @makai410

Some changes occurred in match checking

cc @Nadrieril

The parser was modified, potentially altering the grammar of (stable) Rust
which would be a breaking change.

cc @fmease

HIR ty lowering was modified

cc @fmease

Some changes occurred in compiler/rustc_attr_ir

cc @jdonszelmann, @JonathanBrouwer

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

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

cc @rust-lang/rustfmt

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

cc @rust-lang/clippy

Some changes occurred in compiler/rustc_passes/src/check_attr.rs

cc @jdonszelmann, @JonathanBrouwer

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann, @JonathanBrouwer

This PR changes a file inside tests/crashes. If a crash was fixed, please move into the corresponding ui subdir and add 'Fixes #' to the PR description to autoclose the issue upon merge.

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. 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. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. labels Sep 9, 2026
@rustbot

rustbot commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

BoxyUwU is currently at their maximum review capacity.
They may take a while to respond.

Comment thread compiler/rustc_attr_parsing/src/attributes/semantics.rs Outdated
Comment thread compiler/rustc_ast_passes/src/feature_gate.rs
@rust-log-analyzer

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.

@rust-bors

This comment has been minimized.

@rustbot

rustbot commented Sep 11, 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.

@BoxyUwU BoxyUwU 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.

r=me once CI is green

@bors rollup=never p=1

View changes since this review

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-i686-msvc failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 12, 2026
@rust-bors

rust-bors Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

💔 Test for e36ddcd failed: CI. Failed job:

@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors retry

@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 Sep 12, 2026
@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 Sep 12, 2026
@rust-bors

rust-bors Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: BoxyUwU
Duration: 3h 6m 5s
Pushing 9c99d05 to main...

@github-actions

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 74b3f08 (parent) -> 9c99d05 (this PR)

Test differences

Show 111 test diffs

Stage 1

  • [ui (polonius)] tests/ui/const-generics/mgca/free-const-recursive.rs: pass -> [missing] (J1)
  • [ui (polonius)] tests/ui/const-generics/mgca/free-const-recursive.rs#gca: [missing] -> pass (J1)
  • [ui (polonius)] tests/ui/const-generics/mgca/free-const-recursive.rs#min_gca: [missing] -> pass (J1)
  • [ui (polonius)] tests/ui/const-generics/mgca/suggest-direct-const.rs: [missing] -> pass (J1)
  • [ui (polonius)] tests/ui/const-generics/mgca/suggest-pub-type_const.rs: pass -> [missing] (J1)
  • [ui] tests/ui/const-generics/mgca/free-const-recursive.rs: pass -> [missing] (J2)
  • [ui] tests/ui/const-generics/mgca/free-const-recursive.rs#gca: [missing] -> pass (J2)
  • [ui] tests/ui/const-generics/mgca/free-const-recursive.rs#min_gca: [missing] -> pass (J2)
  • [ui] tests/ui/const-generics/mgca/suggest-direct-const.rs: [missing] -> pass (J2)
  • [ui] tests/ui/const-generics/mgca/suggest-pub-type_const.rs: pass -> [missing] (J2)

Stage 2

  • [ui] tests/ui/const-generics/mgca/free-const-recursive.rs: pass -> [missing] (J0)
  • [ui] tests/ui/const-generics/mgca/free-const-recursive.rs#gca: [missing] -> pass (J0)
  • [ui] tests/ui/const-generics/mgca/free-const-recursive.rs#min_gca: [missing] -> pass (J0)
  • [ui] tests/ui/const-generics/mgca/suggest-direct-const.rs: [missing] -> pass (J0)
  • [ui] tests/ui/const-generics/mgca/suggest-pub-type_const.rs: pass -> [missing] (J0)

Additionally, 96 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 9c99d05505bccb67912d68e05fe7fc7c58afcb41 --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. dist-armv7-linux: 1h 8m -> 1h 39m (+45.9%)
  2. test-i686-gnu-1: 2h 14m -> 1h 16m (-42.9%)
  3. test-x86_64-gnu-stdlib-semver-check: 17m 15s -> 9m 57s (-42.3%)
  4. test-x86_64-msvc-ext2: 1h 13m -> 1h 40m (+37.2%)
  5. test-x86_64-gnu-tools: 1h 10m -> 48m 38s (-31.2%)
  6. dist-x86_64-illumos: 1h 47m -> 1h 14m (-30.7%)
  7. test-x86_64-gnu-stable: 2h 39m -> 1h 50m (-30.4%)
  8. test-i686-gnu-nopt-2: 1h 47m -> 2h 20m (+30.3%)
  9. dist-x86_64-netbsd: 1h 14m -> 1h 36m (+29.7%)
  10. optional-test-x86_64-gnu-autodiff: 55m 8s -> 39m 23s (-28.6%)
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.

@khyperia
khyperia deleted the yeet-type-const branch September 12, 2026 10:28
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (9c99d05): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

Max RSS (memory usage)

Results (primary -1.1%, secondary -2.2%)

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)
2.1% [2.1%, 2.1%] 1
Improvements ✅
(primary)
-1.1% [-2.1%, -0.4%] 9
Improvements ✅
(secondary)
-2.9% [-4.5%, -1.1%] 6
All ❌✅ (primary) -1.1% [-2.1%, -0.4%] 9

Cycles

Results (primary 0.5%)

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

mean range count
Regressions ❌
(primary)
1.0% [0.4%, 3.1%] 8
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.6% [-0.9%, -0.4%] 4
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.5% [-0.9%, 3.1%] 12

Binary size

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

Bootstrap: 493.042s -> 497.802s (0.97%)
Artifact size: 406.92 MiB -> 406.93 MiB (0.00%)

Zalathar added a commit to Zalathar/rust that referenced this pull request Sep 17, 2026
…yUwU

reintroduce check RibKind::ConstParamTy did in direct consts

The ConstParamTy nameres rib checks were never implemented for `gca!`-rhs direct consts. So, when `type const` got removed in rust-lang#162517 and we now only have `gca!`-rhs direct consts, the lack of checks became very apparent
This PR adds the check again for `gca!`-rhs direct consts.

When implementing this and updating `tests/ui/const-generics/mgca/type_const-generic-param-in-type.rs`, I ran into rust-lang#160553 which caused a glaringly obvious issue - the following succeeds compilation:

```rust
#![feature(min_generic_const_args, generic_const_items, generic_const_parameter_types)]
const BAR<const N: usize>: [(); N] = core::direct_const_arg!([]);
```

This is already tracked in `tests/crashes/160553.rs` so I have not added a test for it.

This is the reason I changed the test from `[(); N]` to `StructWithConstParam<const N: usize>`, the RHS has to, like, y'know, actually typecheck :P

r? @BoxyUwU
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 17, 2026
…yUwU

reintroduce check RibKind::ConstParamTy did in direct consts

The ConstParamTy nameres rib checks were never implemented for `gca!`-rhs direct consts. So, when `type const` got removed in rust-lang#162517 and we now only have `gca!`-rhs direct consts, the lack of checks became very apparent
This PR adds the check again for `gca!`-rhs direct consts.

When implementing this and updating `tests/ui/const-generics/mgca/type_const-generic-param-in-type.rs`, I ran into rust-lang#160553 which caused a glaringly obvious issue - the following succeeds compilation:

```rust
#![feature(min_generic_const_args, generic_const_items, generic_const_parameter_types)]
const BAR<const N: usize>: [(); N] = core::direct_const_arg!([]);
```

This is already tracked in `tests/crashes/160553.rs` so I have not added a test for it.

This is the reason I changed the test from `[(); N]` to `StructWithConstParam<const N: usize>`, the RHS has to, like, y'know, actually typecheck :P

r? @BoxyUwU
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 17, 2026
…yUwU

reintroduce check RibKind::ConstParamTy did in direct consts

The ConstParamTy nameres rib checks were never implemented for `gca!`-rhs direct consts. So, when `type const` got removed in rust-lang#162517 and we now only have `gca!`-rhs direct consts, the lack of checks became very apparent
This PR adds the check again for `gca!`-rhs direct consts.

When implementing this and updating `tests/ui/const-generics/mgca/type_const-generic-param-in-type.rs`, I ran into rust-lang#160553 which caused a glaringly obvious issue - the following succeeds compilation:

```rust
#![feature(min_generic_const_args, generic_const_items, generic_const_parameter_types)]
const BAR<const N: usize>: [(); N] = core::direct_const_arg!([]);
```

This is already tracked in `tests/crashes/160553.rs` so I have not added a test for it.

This is the reason I changed the test from `[(); N]` to `StructWithConstParam<const N: usize>`, the RHS has to, like, y'know, actually typecheck :P

r? @BoxyUwU
rust-bors Bot pushed a commit that referenced this pull request Sep 17, 2026
Rollup merge of #162842 - khyperia:ConstParamTy-check, r=BoxyUwU

reintroduce check RibKind::ConstParamTy did in direct consts

The ConstParamTy nameres rib checks were never implemented for `gca!`-rhs direct consts. So, when `type const` got removed in #162517 and we now only have `gca!`-rhs direct consts, the lack of checks became very apparent
This PR adds the check again for `gca!`-rhs direct consts.

When implementing this and updating `tests/ui/const-generics/mgca/type_const-generic-param-in-type.rs`, I ran into #160553 which caused a glaringly obvious issue - the following succeeds compilation:

```rust
#![feature(min_generic_const_args, generic_const_items, generic_const_parameter_types)]
const BAR<const N: usize>: [(); N] = core::direct_const_arg!([]);
```

This is already tracked in `tests/crashes/160553.rs` so I have not added a test for it.

This is the reason I changed the test from `[(); N]` to `StructWithConstParam<const N: usize>`, the RHS has to, like, y'know, actually typecheck :P

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

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) merged-by-bors This PR was explicitly merged by bors. T-clippy Relevant to the Clippy team. 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. T-rustfmt Relevant to the rustfmt 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