Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
assertion failed: layout.is_sized()withfeature(adt_const_params)#137582The 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