Fix ICE in const param defaults with lifetime-dependent types#149254
Fix ICE in const param defaults with lifetime-dependent types#149254lapla-cogito wants to merge 1 commit intorust-lang:mainfrom
Conversation
|
r? @fee1-dead rustbot has assigned @fee1-dead. Use |
|
r? BoxyUwU |
|
In theory anonymous constants aren't supposed to work with I think in |
|
@rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
|
☔ The latest upstream changes (presumably #150798) made this pull request unmergeable. Please resolve the merge conflicts. |
|
hiya, sorry this fix wound up being merged as part of a different PR. I still think it would be good to look into what I mentioned above though. Going to close this for now but if you're interested in taking a look into that, that'd be great |
fixes #142913
The ICE happened because
const_param_defaultinstantiated the default expression using the const parameter’s own identity arguments, which are empty. When the default’s type referenced earlier generics, the subsequentinstantiatecall saw parameters but no arguments and panicked. In this PR, supplying the slice of the parent’s generic arguments up to the parameter being defaulted prevents that mismatch.