Skip to content

Avoid relating erased regions in valtree field types - #160059

Open
amirHdev wants to merge 1 commit into
rust-lang:mainfrom
amirHdev:fix-mgca-erased-region
Open

amirHdev wants to merge 1 commit into
rust-lang:mainfrom
amirHdev:fix-mgca-erased-region

Conversation

@amirHdev

@amirHdev amirHdev commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #159688

@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. labels Jul 28, 2026
@amirHdev
amirHdev marked this pull request as ready for review July 28, 2026 12:48
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 28, 2026
@rustbot

rustbot commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

changes to the core type system

cc @lcnr

@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 Jul 28, 2026
@rustbot

rustbot commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

r? @TaKO8Ki

rustbot has assigned @TaKO8Ki.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 74 candidates
  • Random selection from 16 candidates

@lcnr lcnr left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

cc @rust-lang/project-const-generics this feels wrong. We should not encounter erased regions inside of the type system. cc https://rust-lang.zulipchat.com/#narrow/channel/618216-t-types.2Fcall-for-participation/topic/adt_const_params.3A.20unnormalized.20type.20of.20valtree/with/613355575 which feels related

View changes since this review

@lcnr

lcnr commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

The type used for const values should be the non-erased type of the expected result type I think. Feel free to start a discussion about this on zulip 🤔 not fully sure

@lcnr lcnr 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-review Status: Awaiting review from the assignee but also interested parties. labels Aug 10, 2026
@BoxyUwU

BoxyUwU commented Aug 10, 2026

Copy link
Copy Markdown
Member

r? me

@rustbot rustbot assigned BoxyUwU and unassigned TaKO8Ki Aug 10, 2026
@amirHdev

amirHdev commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor Author

cc @rust-lang/project-const-generics this feels wrong. We should not encounter erased regions inside of the type system. cc https://rust-lang.zulipchat.com/#narrow/channel/618216-t-types.2Fcall-for-participation/topic/adt_const_params.3A.20unnormalized.20type.20of.20valtree/with/613355575 which feels related

View changes since this review

I tested the #159688 regression on top of #160526 without the wf.rs change from this patch It still ICEs with:
cannot relate region: LUB('static, '{erased})
#160526 doesn't appear to cover this erased-region case

Signed-off-by: Amirhossein Akhlaghpour <m9.akhlaghpoor@gmail.com>
@amirHdev
amirHdev force-pushed the fix-mgca-erased-region branch from 08adb27 to 95f329b Compare September 1, 2026 13:16
@rustbot

rustbot commented Sep 1, 2026

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.

@amirHdev

Copy link
Copy Markdown
Contributor Author

restoring the valtree child types after const evaluation avoids the ICE with both solvers and the const-generics tests pass

I'm still unsure how to handle field types that are unnormalized projections

@lcnr do you think this is the right place for the fix?

@lcnr

lcnr commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

probably not, might make sense to start a thread in https://rust-lang.zulipchat.com/#narrow/channel/260443-project-const-generics for it

This branch has not been deployed

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

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ICE]: mgca: cannot relate region: LUB

5 participants