Skip to content

Emit fatal on invalid const args with nested defs#154595

Open
mu001999 wants to merge 1 commit intorust-lang:mainfrom
mu001999-contrib:fix/154539
Open

Emit fatal on invalid const args with nested defs#154595
mu001999 wants to merge 1 commit intorust-lang:mainfrom
mu001999-contrib:fix/154539

Conversation

@mu001999
Copy link
Copy Markdown
Contributor

Fixes #154539

Invalid const args are rejected, so their surrounding HIR is not preserved. But nested defs inside them can still get created, leaving children lowered without a valid HIR parent and causing an ICE when later error handling walks HIR parents.

Another possible fix would be to do a similar check earlier, but it may change the surface syntax accepted now.

r? @BoxyUwU

@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. labels Mar 30, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 30, 2026

BoxyUwU is currently at their maximum review capacity.
They may take a while to respond.

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

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ICE]: mgca: No HirId for DefId

3 participants