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.

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
Zalathar added a commit to Zalathar/rust that referenced this pull request Jan 11, 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
Zalathar added a commit to Zalathar/rust that referenced this pull request Jan 11, 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 bot added a commit that referenced this pull request Jan 11, 2026
Rollup of 14 pull requests

Successful merges:

 - #148941 (stabilize `Peekable::next_if_map` (`#![feature(peekable_next_if_map)]`))
 - #150368 (adding Ordering enum to minicore.rs, importing minicore in "tests/assembly-llvm/rust-abi-arg-attr.rs" test file)
 - #150668 (Unix implementation for stdio set/take/replace)
 - #150743 (Reword the collect() docs)
 - #150776 (Fix the connect_error test on FreeBSD 15+)
 - #150781 (Use `rand` crate more idiomatically)
 - #150786 (mGCA: Support array expression as direct const arguments)
 - #150812 (Bump `diesel` to the most recent commit in `cargotest`)
 - #150862 (std: sys: fs: uefi: Implement File::flush)
 - #150873 (Reenable GCC CI download)
 - #150908 (llvm: Update `reliable_f16` configuration for LLVM22)
 - #150918 (std: sys: fs: uefi: Implement File::seek)
 - #150922 (Subscribe myself to attr parsing)
 - #150930 (Remove special case for `AllowedTargets::CrateLevel`)

r? @ghost
@matthiaskrgr
Copy link
Member

@bors r-
looke like this failed here? #150952 (comment)

@rust-bors rust-bors bot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jan 11, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 11, 2026

Commit f2f45ff has been unapproved.

@rust-bors rust-bors bot removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 11, 2026
@Zalathar
Copy link
Member

Though note that the same job previously succeeded in #150948 (comment), so it might be flaky.

@bors try jobs=x86_64-mingw-1

rust-bors bot added a commit that referenced this pull request Jan 11, 2026
mGCA: Support array expression as direct const arguments

try-job: x86_64-mingw-1
@rust-bors

This comment has been minimized.

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 11, 2026

☀️ Try build successful (CI)
Build commit: 69e457f (69e457f0cdcb1773572306926cc50b0547aaf7c4, parent: 9bc8b40bc314b74e1d5e5ab21a0df39c55a34806)

@BoxyUwU
Copy link
Member

BoxyUwU commented Jan 11, 2026

I don't see anything in this PR that could cause that test to fail 🤔 Going to re-approve this PR, if that test is flakily failing (which it seems so) we should probably disable it so it stops causing rollups to fail.

@bors r+

@rust-bors rust-bors bot added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 11, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 11, 2026

📌 Commit f2f45ff has been approved by BoxyUwU

It is now in the queue for this repository.

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

BoxyUwU commented Jan 11, 2026

though
@bors rollup=never
just in case this PR for some reason actually is causing problems here

@rust-bors

This comment has been minimized.

@rust-bors rust-bors bot added the merged-by-bors This PR was explicitly merged by bors. label Jan 12, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 12, 2026

☀️ Test successful - CI
Approved by: BoxyUwU
Pushing 1377169 to main...

@rust-bors rust-bors bot merged commit 1377169 into rust-lang:main Jan 12, 2026
13 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Jan 12, 2026
@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 b115ea2 (parent) -> 1377169 (this PR)

Test differences

Show 38 test diffs

Stage 1

  • [ui] tests/ui/const-generics/mgca/array-expr-complex.rs: [missing] -> pass (J1)
  • [ui] tests/ui/const-generics/mgca/array-expr-empty.rs: [missing] -> pass (J1)
  • [ui] tests/ui/const-generics/mgca/array-expr-simple.rs: [missing] -> pass (J1)
  • [ui] tests/ui/const-generics/mgca/array-expr-with-assoc-const.rs: [missing] -> pass (J1)
  • [ui] tests/ui/const-generics/mgca/array-expr-with-macro.rs: [missing] -> pass (J1)
  • [ui] tests/ui/const-generics/mgca/array-expr-with-struct.rs: [missing] -> pass (J1)
  • [ui] tests/ui/const-generics/mgca/array-expr-with-tuple.rs: [missing] -> pass (J1)

Stage 2

  • [ui] tests/ui/const-generics/mgca/array-expr-complex.rs: [missing] -> pass (J0)
  • [ui] tests/ui/const-generics/mgca/array-expr-empty.rs: [missing] -> pass (J0)
  • [ui] tests/ui/const-generics/mgca/array-expr-simple.rs: [missing] -> pass (J0)
  • [ui] tests/ui/const-generics/mgca/array-expr-with-assoc-const.rs: [missing] -> pass (J0)
  • [ui] tests/ui/const-generics/mgca/array-expr-with-macro.rs: [missing] -> pass (J0)
  • [ui] tests/ui/const-generics/mgca/array-expr-with-struct.rs: [missing] -> pass (J0)
  • [ui] tests/ui/const-generics/mgca/array-expr-with-tuple.rs: [missing] -> pass (J0)

Additionally, 24 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 137716908d561bfcf0341701ec13a28326926c82 --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-x86_64-apple: 6736.5s -> 9701.5s (+44.0%)
  2. dist-aarch64-apple: 9467.1s -> 7232.2s (-23.6%)
  3. pr-check-1: 1687.7s -> 2022.8s (+19.9%)
  4. i686-gnu-2: 5166.9s -> 6024.6s (+16.6%)
  5. dist-apple-various: 4969.1s -> 4200.1s (-15.5%)
  6. x86_64-gnu-gcc: 3024.7s -> 3453.5s (+14.2%)
  7. x86_64-rust-for-linux: 2692.8s -> 3052.4s (+13.4%)
  8. x86_64-gnu-llvm-20: 4285.7s -> 4802.3s (+12.1%)
  9. aarch64-gnu-debug: 3748.6s -> 4191.2s (+11.8%)
  10. arm-android: 5756.9s -> 6426.3s (+11.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.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1377169): 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)

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

Cycles

Results (secondary 3.3%)

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

Binary size

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

Bootstrap: 473.644s -> 473.493s (-0.03%)
Artifact size: 391.40 MiB -> 391.40 MiB (-0.00%)

@reddevilmidzy reddevilmidzy deleted the mgca-array branch January 13, 2026 06:08
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-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

7 participants