Skip to content

MGCA: Const constructors support - #150704

Merged
bors merged 1 commit into
rust-lang:mainfrom
Kivooeo:const-ctor
Jan 6, 2026
Merged

MGCA: Const constructors support#150704
bors merged 1 commit into
rust-lang:mainfrom
Kivooeo:const-ctor

Conversation

@Kivooeo

@KivooeoKivooeo commented Jan 5, 2026

Copy link
Copy Markdown
Member

part of #132980

fixes#132985
fixes#136138
fixes#139596

r? BoxyUwU

@rustbot

Copy link
Copy Markdown
Collaborator

HIR ty lowering was modified

cc @fmease

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.

@rustbotrustbot 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 Jan 5, 2026
@rustbot

Copy link
Copy Markdown
Collaborator

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

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

awesome! Can you add a test for const constructors using generic parameters, e.g. Option::None::<T> or Struct::<T>

View changes since this review

Comment threadtests/ui/const-generics/mgca/const-ctor.rs Outdated
Comment threadtests/ui/const-generics/mgca/const-ctor-with-error.rs
@rust-log-analyzer

This comment has been minimized.

@rust-cloud-vms
rust-cloud-vmsBotforce-pushed the const-ctor branch 2 times, most recently from cf333f5 to e4c0415CompareJanuary 5, 2026 20:52

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

@fmease

fmease commented Jan 6, 2026

Copy link
Copy Markdown
Member

Did you really mean to link to issue #105952 in the PR description (esp. after keyword Fixes)? That issue was fixed 3 years ago & isn't related to the changes made in this PR.

@rust-bors

rust-borsBot commented Jan 6, 2026

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes made this pull request unmergeable. Please resolve the merge conflicts.

@bors

bors commented Jan 6, 2026

Copy link
Copy Markdown
Collaborator

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

@Kivooeo

Copy link
Copy Markdown
MemberAuthor

Did you really mean to link to issue #105952 in the PR description

Yes, because there were very similar test case in crashes with link to this issue which still ICEs, and this ICE was fixed by that PR

Removed link from description in case that will cause any confusion

@rustbot

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.

@rust-log-analyzer

This comment has been minimized.

Comment threadtests/crashes/mgca/ace-with-const-ctor.rs
@rustbotrustbot added the T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. label Jan 6, 2026
@rust-cloud-vms
rust-cloud-vmsBotforce-pushed the const-ctor branch 2 times, most recently from abd5747 to bfd4c97CompareJanuary 6, 2026 15:01
@BoxyUwU

Copy link
Copy Markdown
Member

@bors r+ rollup

cool!

@bors

bors commented Jan 6, 2026

Copy link
Copy Markdown
Collaborator

📌 Commit d32f1c6 has been approved by BoxyUwU

It is now in the queue for this repository.

@borsbors 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 Jan 6, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jan 6, 2026
bors added a commit that referenced this pull request Jan 6, 2026
Rollup of 4 pull requests
Successful merges:
- #150026 (Fix macro_metavar_expr_concat behavior with nested repetitions)
- #150521 (resolve: Rename "name bindings" to "name declarations")
- #150704 (MGCA: Const constructors support)
- #150728 (Cleanup some ui tests for const-traits)
r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Jan 6, 2026
Rollup of 4 pull requests
Successful merges:
- #150026 (Fix macro_metavar_expr_concat behavior with nested repetitions)
- #150521 (resolve: Rename "name bindings" to "name declarations")
- #150704 (MGCA: Const constructors support)
- #150728 (Cleanup some ui tests for const-traits)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 9c45483 into rust-lang:mainJan 6, 2026
11 checks passed
@rustbotrustbot added this to the 1.94.0 milestone Jan 6, 2026
rust-timer added a commit that referenced this pull request Jan 6, 2026
Rollup merge of #150704 - Kivooeo:const-ctor, r=BoxyUwU
MGCA: Const constructors support
part of #132980fixes#132985fixes#136138fixes#139596
r? BoxyUwU
AprilNEA added a commit to AprilNEA/rust that referenced this pull request Feb 9, 2026
Using a struct constructor (DefKind::Ctor(Struct, Const)) as an array
repeat count with `#![feature(min_generic_const_args)]` used to trigger
an ICE in const alias normalization. This was fixed by PR rust-lang#150704, which
added const constructor support for MGCA. Add a regression test to
ensure the compiler produces a proper type error instead of panicking.
Closesrust-lang#141738
jhpratt added a commit to jhpratt/rust that referenced this pull request Feb 15, 2026
…ctor-array-len, r=BoxyUwU
Add regression test for rust-lang#141738Closesrust-lang#141738
- Add a regression test for rust-lang#141738
- Using a struct constructor (`DefKind::Ctor(Struct, Const)`) as an array repeat count with `#![feature(min_generic_const_args)]` used to ICE in const alias normalization
- Fixed by rust-lang#150704, which added const constructor support for mGCA. This test covers the **error path** (struct ctor where `usize` is expected), which was not covered by the tests in rust-lang#150704
rust-timer added a commit that referenced this pull request Feb 15, 2026
Rollup merge of #152402 - AprilNEA:test/issue-141738-struct-ctor-array-len, r=BoxyUwU
Add regression test for #141738Closes#141738
- Add a regression test for #141738
- Using a struct constructor (`DefKind::Ctor(Struct, Const)`) as an array repeat count with `#![feature(min_generic_const_args)]` used to ICE in const alias normalization
- Fixed by #150704, which added const constructor support for mGCA. This test covers the **error path** (struct ctor where `usize` is expected), which was not covered by the tests in #150704
github-actionsBot pushed a commit to rust-lang/stdarch that referenced this pull request Feb 16, 2026
…y-len, r=BoxyUwU
Add regression test for #141738
Closesrust-lang/rust#141738
- Add a regression test for rust-lang/rust#141738
- Using a struct constructor (`DefKind::Ctor(Struct, Const)`) as an array repeat count with `#![feature(min_generic_const_args)]` used to ICE in const alias normalization
- Fixed by rust-lang/rust#150704, which added const constructor support for mGCA. This test covers the **error path** (struct ctor where `usize` is expected), which was not covered by the tests in rust-lang/rust#150704
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-rustdoc-frontendRelevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

6 participants

@Kivooeo@rustbot@rust-log-analyzer@fmease@bors@BoxyUwU