Skip to content

Conversation

@mu001999
Copy link
Contributor

@mu001999 mu001999 commented Jan 11, 2026

r? @BoxyUwU

Fixes #151048

edit: BoxyUwU

FeedConstTy currently only provides the expected type of a const argument sometimes (e.g. previously array lengths did not do this). This causes problems with mGCA's directly represented const arguments which always need to know their expected type.

@rustbot
Copy link
Collaborator

rustbot commented Jan 11, 2026

HIR ty lowering was modified

cc @fmease

@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. labels Jan 11, 2026
@rust-log-analyzer

This comment has been minimized.

Copy link
Member

@BoxyUwU BoxyUwU left a comment

Choose a reason for hiding this comment

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

This is great :)

Can you update type_of.rs to no longer have fn const_arg_anon_type_of and replace its one call site with the logic of the wildcard arm that currently is in const_arg_anon_type_of. In theory none of the other codepaths should be necessary now that we always pass in a type during HIR ty lowering.

View changes since this review

@rust-log-analyzer

This comment has been minimized.

@mu001999
Copy link
Contributor Author

Seems because the removal of const_arg_anon_type_of 🤔

@mu001999
Copy link
Contributor Author

Recover const_arg_anon_type_of, seems we still need it.

@BoxyUwU
Copy link
Member

BoxyUwU commented Jan 12, 2026

Oh that's unfortunate, I wonder what's going on there

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 12, 2026

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

@rustbot
Copy link
Collaborator

rustbot commented Jan 13, 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.

@mu001999
Copy link
Contributor Author

@BoxyUwU I think the two failed tests (tests/ui/closures/issue-90871.rs and tests/ui/type/pattern_types/nested.rs) show that we still will call type_of before lowering const args in these features' implementation.

@BoxyUwU
Copy link
Member

BoxyUwU commented Jan 13, 2026

@bors r+

cool!

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

rust-bors bot commented Jan 13, 2026

📌 Commit d1c2e5c has been approved by BoxyUwU

It is now in the queue for this repository.

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jan 13, 2026
Remove `FeedConstTy` and provide ty when lowering const arg

r? @BoxyUwU

edit: BoxyUwU

`FeedConstTy` currently only provides the expected type of a const argument *sometimes* (e.g. previously array lengths did not do this). This causes problems with mGCA's directly represented const arguments which always need to know their expected type.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jan 13, 2026
Remove `FeedConstTy` and provide ty when lowering const arg

r? @BoxyUwU

edit: BoxyUwU

`FeedConstTy` currently only provides the expected type of a const argument *sometimes* (e.g. previously array lengths did not do this). This causes problems with mGCA's directly represented const arguments which always need to know their expected type.
rust-bors bot pushed a commit that referenced this pull request Jan 13, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #150586 (rustdoc: Fix intra-doc link bugs involving type aliases and associated items)
 - #150677 (Improve std::path::Path::join documentation)
 - #150723 (std: move `errno` and related functions into `sys::io`)
 - #150737 (diagnostics: make implicit Sized bounds explicit in E0277)
 - #150771 (Remove legacy homu `try` and `auto` branch mentions)
 - #150915 (Regression test for type params on eii)
 - #150962 (Remove `FeedConstTy` and provide ty when lowering const arg)
 - #151017 (Port the rustc dump attributes to the attribute parser)
 - #151019 (Make `Type::of` support unsized types)
 - #151034 (std: Change UEFI env vars to volatile storage)
 - #151052 (ui: add regression test for macro resolution ICE (issue #150711))
 - #151053 (Reduce flakyness for `tests/rustdoc-gui/notable-trait.goml`)
 - #151055 (Emit error instead of delayed bug when meeting mismatch type for const array)

r? @ghost
@JonathanBrouwer
Copy link
Contributor

@bors try jobs=dist-x86_64-linux-alt

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Jan 14, 2026
Remove `FeedConstTy` and provide ty when lowering const arg


try-job: dist-x86_64-linux-alt
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 14, 2026

☀️ Try build successful (CI)
Build commit: e00829c (e00829c2fbefd93907c51cdd47d31a0efb0b6cfd, parent: 4931e09e3ac3182d2a00f38cccfdf68e8e385e1c)

@mu001999
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 14, 2026
@BoxyUwU
Copy link
Member

BoxyUwU commented Jan 14, 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-review Status: Awaiting review from the assignee but also interested parties. labels Jan 14, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 14, 2026

📌 Commit 12b4b72 has been approved by BoxyUwU

It is now in the queue for this repository.

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jan 14, 2026
Remove `FeedConstTy` and provide ty when lowering const arg

r? @BoxyUwU

edit: BoxyUwU

`FeedConstTy` currently only provides the expected type of a const argument *sometimes* (e.g. previously array lengths did not do this). This causes problems with mGCA's directly represented const arguments which always need to know their expected type.
rust-bors bot pushed a commit that referenced this pull request Jan 14, 2026
…uwer

Rollup of 16 pull requests

Successful merges:

 - #150585 (Add a context-consistency check before emitting redundant generic-argument suggestions)
 - #150586 (rustdoc: Fix intra-doc link bugs involving type aliases and associated items)
 - #150590 (Don't try to recover keyword as non-keyword identifier )
 - #150817 (cleanup: remove borrowck handling for inline const patterns)
 - #150939 (resolve: Relax some asserts in glob overwriting and add tests)
 - #150962 (Remove `FeedConstTy` and provide ty when lowering const arg)
 - #150966 (rustc_target: Remove unused Arch::PowerPC64LE)
 - #150971 (Disallow eii in statement position)
 - #151016 (fix: WASI threading regression by disabling pthread usage)
 - #151046 (compiler: Make Externally Implementable Item (eii) macros "semiopaque")
 - #151099 (Recover parse gracefully from `<const N>`)
 - #151117 (Avoid serde dependency in build_helper when not necessary)
 - #151127 (Delete `MetaItemOrLitParser::Err`)
 - #151128 (Add temporary new bors e-mail address to the mailmap)
 - #151130 (resolve: Downgrade `ambiguous_glob_imports` to warn-by-default)
 - #151138 (Rename `rust.use-lld` to `rust.bootstrap-override-lld` in INSTALL.md)

r? @ghost
rust-bors bot pushed a commit that referenced this pull request Jan 14, 2026
…uwer

Rollup of 15 pull requests

Successful merges:

 - #150585 (Add a context-consistency check before emitting redundant generic-argument suggestions)
 - #150586 (rustdoc: Fix intra-doc link bugs involving type aliases and associated items)
 - #150590 (Don't try to recover keyword as non-keyword identifier )
 - #150817 (cleanup: remove borrowck handling for inline const patterns)
 - #150939 (resolve: Relax some asserts in glob overwriting and add tests)
 - #150962 (Remove `FeedConstTy` and provide ty when lowering const arg)
 - #150966 (rustc_target: Remove unused Arch::PowerPC64LE)
 - #150971 (Disallow eii in statement position)
 - #151016 (fix: WASI threading regression by disabling pthread usage)
 - #151046 (compiler: Make Externally Implementable Item (eii) macros "semiopaque")
 - #151099 (Recover parse gracefully from `<const N>`)
 - #151117 (Avoid serde dependency in build_helper when not necessary)
 - #151127 (Delete `MetaItemOrLitParser::Err`)
 - #151128 (Add temporary new bors e-mail address to the mailmap)
 - #151138 (Rename `rust.use-lld` to `rust.bootstrap-override-lld` in INSTALL.md)

r? @ghost
@rust-bors rust-bors bot merged commit 27e6ef9 into rust-lang:main Jan 15, 2026
12 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Jan 15, 2026
rust-timer added a commit that referenced this pull request Jan 15, 2026
Rollup merge of #150962 - rm/feed_const_ty, r=BoxyUwU

Remove `FeedConstTy` and provide ty when lowering const arg

r? @BoxyUwU

edit: BoxyUwU

`FeedConstTy` currently only provides the expected type of a const argument *sometimes* (e.g. previously array lengths did not do this). This causes problems with mGCA's directly represented const arguments which always need to know their expected type.
@mu001999 mu001999 deleted the rm/feed_const_ty branch January 15, 2026 02:54
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jan 15, 2026
…uwer

Rollup of 15 pull requests

Successful merges:

 - rust-lang/rust#150585 (Add a context-consistency check before emitting redundant generic-argument suggestions)
 - rust-lang/rust#150586 (rustdoc: Fix intra-doc link bugs involving type aliases and associated items)
 - rust-lang/rust#150590 (Don't try to recover keyword as non-keyword identifier )
 - rust-lang/rust#150817 (cleanup: remove borrowck handling for inline const patterns)
 - rust-lang/rust#150939 (resolve: Relax some asserts in glob overwriting and add tests)
 - rust-lang/rust#150962 (Remove `FeedConstTy` and provide ty when lowering const arg)
 - rust-lang/rust#150966 (rustc_target: Remove unused Arch::PowerPC64LE)
 - rust-lang/rust#150971 (Disallow eii in statement position)
 - rust-lang/rust#151016 (fix: WASI threading regression by disabling pthread usage)
 - rust-lang/rust#151046 (compiler: Make Externally Implementable Item (eii) macros "semiopaque")
 - rust-lang/rust#151099 (Recover parse gracefully from `<const N>`)
 - rust-lang/rust#151117 (Avoid serde dependency in build_helper when not necessary)
 - rust-lang/rust#151127 (Delete `MetaItemOrLitParser::Err`)
 - rust-lang/rust#151128 (Add temporary new bors e-mail address to the mailmap)
 - rust-lang/rust#151138 (Rename `rust.use-lld` to `rust.bootstrap-override-lld` in INSTALL.md)

r? @ghost
@JonathanBrouwer
Copy link
Contributor

@rust-timer queue 8ea72d4

@rust-timer
Copy link
Collaborator

Error occurred while parsing comment: Invalid command argument 8ea72d4988a359ba48641ca81b9ec044007c9a99 (there may be no spaces around the = character)

@JonathanBrouwer
Copy link
Contributor

@rust-timer build 8ea72d4

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (8ea72d4): comparison URL.

Overall result: ❌ regressions - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.3% [0.6%, 2.1%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 2.6%)

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

mean range count
Regressions ❌
(primary)
2.6% [2.6%, 2.6%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.6% [2.6%, 2.6%] 1

Cycles

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.8%] 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: 475.838s -> 473.206s (-0.55%)
Artifact size: 383.64 MiB -> 383.65 MiB (0.00%)

@rustbot rustbot added the perf-regression Performance regression. label Jan 15, 2026
@JonathanBrouwer
Copy link
Contributor

JonathanBrouwer commented Jan 15, 2026

This caused the perf regression in #151144

@BoxyUwU
Copy link
Member

BoxyUwU commented Jan 15, 2026

wild

@BoxyUwU
Copy link
Member

BoxyUwU commented Jan 15, 2026

unsure what caused this, all the logic in this PR is either const generics only or diagnostics path stuff 🤔 this bench doesn't have any const generics 🤔 given it's a stress test though I'd be inclined to accept this given it's likely to be very minimal affect on real world code? It would be nice to fix this though

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

Labels

perf-regression Performance regression. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ICE const tuple lack type information

7 participants