Skip to content

Conversation

@mu001999
Copy link
Contributor

@mu001999 mu001999 commented Jan 11, 2026

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.

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

5 participants