Skip to content

Conversation

@khyperia
Copy link
Contributor

@khyperia khyperia commented Jan 30, 2026

The constant evaluator does not support unsized types, however, unsized AnonConsts were never checked to be Sized, so no errors were generated on them and the constant was attempted to be constant evaluated. This caused the constant evaluator to ICE.

Add a special case for AnonConsts in rustc_hir_typeck, as suggested by @BoxyUwU in #137582. There is no checking for #![feature(unsized_const_params)] which should eventually revert this check when the feature becomes more implemented.

That issue is assigned to @el-ev but I started looking into this as a jumping off point / motivation to learn some compiler stuff, and I eventually got to the point of fixing it, so I'm submitting a PR anyway. So just a ping/FYI to @el-ev that I'm submitting this, sorry!

There are three relevant github issues to this ICE that I could find:

The similar issue #104685 is NOT fixed, it might be good to glance at that before verifying this particular fix, to make sure this fix is actually in the right place. (I haven't looked at it much)

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 Jan 30, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 30, 2026

⚠️ Warning ⚠️

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]: assertion failed: layout.is_sized() ICE: assertion failed: layout.is_sized() with feature(adt_const_params)

3 participants