Skip to content

Conversation

@reddevilmidzy
Copy link
Member

@reddevilmidzy reddevilmidzy commented Jan 8, 2026

tracking issue: #132980
resolve: #150612

Support array expression as direct const arguments (e. g. [1, 2, N]) in min_generic_const_args.

todo:

  • Rebase another mGCA PR
  • Add more test case
  • Modify clippy code

@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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jan 8, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added the T-clippy Relevant to the Clippy team. label Jan 8, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 8, 2026

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

@BoxyUwU BoxyUwU self-assigned this Jan 8, 2026
let tcx = self.tcx();

let array_len = array_expr.elems.len() as u64;
let elem_ty = self.ty_infer(None, array_expr.span);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using a ty_infer here isn't quite what you want, this will make it so that using array expressions in type signatures will cause an error due to having _ in your type signature.

it might be useful to look at the recent PR adding support for (N, N2, const { 1 + 1 }) to mgca which has to do very similar logic to what you need to do here: https://github.com/rust-lang/rust/pull/150675/files#diff-ce4273e1e949bf3052de7a08466c4dad785890b24091122954541b615b0ba199R2488-R2513

(you'll probably need to rebase onto latest main too to get the FeedConstTy changes :3)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review! I changed the type infer to use a different method than ty_infer and added related tests.

@BoxyUwU
Copy link
Member

BoxyUwU commented Jan 8, 2026

Looks good so far :) thanks for taking this on

@reddevilmidzy reddevilmidzy force-pushed the mgca-array branch 2 times, most recently from 9fdd556 to 21e092f Compare January 9, 2026 04:16
@reddevilmidzy reddevilmidzy changed the title MGCA: Support array expression as direct const arguments mGCA: Support array expression as direct const arguments Jan 9, 2026
@reddevilmidzy reddevilmidzy marked this pull request as ready for review January 9, 2026 06:58
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 9, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 9, 2026

HIR ty lowering was modified

cc @fmease

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jan 9, 2026
@BoxyUwU
Copy link
Member

BoxyUwU commented Jan 9, 2026

thanks!

@bors r+ rollup

@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 Jan 9, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 9, 2026

📌 Commit 49b8c2b has been approved by BoxyUwU

It is now in the queue for this repository.

tgross35 added a commit to tgross35/rust that referenced this pull request Jan 9, 2026
mGCA: Support array expression as direct const arguments

tracking issue: rust-lang#132980
resolve: rust-lang#150612

Support array expression as direct const arguments (e. g. [1, 2, N]) in min_generic_const_args.

todo:
* [x] Rebase another mGCA PR
* [x] Add more test case
* [x] Modify clippy code
@rust-bors rust-bors bot 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 Jan 10, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 10, 2026

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

This pull request was unapproved.

@rustbot
Copy link
Collaborator

rustbot commented Jan 10, 2026

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

BoxyUwU commented Jan 10, 2026

@bors r+ :)

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 10, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 10, 2026

📌 Commit f2f45ff has been approved by BoxyUwU

It is now in the queue for this repository.

Zalathar added a commit to Zalathar/rust that referenced this pull request Jan 10, 2026
mGCA: Support array expression as direct const arguments

tracking issue: rust-lang#132980
resolve: rust-lang#150612

Support array expression as direct const arguments (e. g. [1, 2, N]) in min_generic_const_args.

todo:
* [x] Rebase another mGCA PR
* [x] Add more test case
* [x] Modify clippy code
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jan 10, 2026
mGCA: Support array expression as direct const arguments

tracking issue: rust-lang#132980
resolve: rust-lang#150612

Support array expression as direct const arguments (e. g. [1, 2, N]) in min_generic_const_args.

todo:
* [x] Rebase another mGCA PR
* [x] Add more test case
* [x] Modify clippy code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MGCA: Support array expressions as direct const arguments

4 participants