Fix ICE in normalizing inherent associated consts with #[type_const]#152000
Fix ICE in normalizing inherent associated consts with #[type_const]#152000lapla-cogito wants to merge 4 commits intorust-lang:mainfrom
#[type_const]#152000Conversation
|
r? @nnethercote rustbot has assigned @nnethercote. Use |
f17f9ac to
5d73196
Compare
This comment has been minimized.
This comment has been minimized.
|
Reminder, once the PR becomes ready for a review, use |
|
r? @fmease |
|
|
|
If you're interested in fixing this I would recommend reading through #project-const-generics > Inherent associated consts (`IAC`) under `MGCA` as I talk there about what a proper fix for our improper handling of inherent associated consts would be |
|
I expect that we'll need to make |
|
@BoxyUwU Thank you! I'm interested in resolving this ICE issue series, so I reviewed the thread you provided. I have several questions:
|
|
oh apparently yes I did implement a lot of that? cool.. In that case I think the two things necessary now are:
In which case doing it all in this PR seems totally reasonable :) |
5d73196 to
4549eac
Compare
This comment has been minimized.
This comment has been minimized.
4549eac to
4d4686e
Compare
|
I've implemented the necessary measures to suppress the ICE (though proper handling of crashtest cases that no longer crash remains necessary). However, |
This comment has been minimized.
This comment has been minimized.
|
Now the remaining concern is how to handle the |
51946c0 to
11c1a57
Compare
This comment has been minimized.
This comment has been minimized.
|
That test failure isn't your fault. rustdoc is broken right now, see #152194 |
|
Yes, I saw it just a moment ago :) |
11c1a57 to
22885d2
Compare
|
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. |
|
@bors r+ rollup thanks :3 |
Fix ICE in normalizing inherent associated consts with `#[type_const]` Fixes rust-lang#151027 Fixes rust-lang#138089 Fixes rust-lang#138226 Fixes rust-lang#150960 When an inherent associated const is marked with `#[type_const]`, its generics expect args in the format `[Self, own_params...]`, similar to inherent associated types. However, HIR typeck's `instantiate_value_path` was constructing args in the regular associated const format `[impl_params..., own_params...]`. This mismatch caused ICEs when the `args` were later used in contexts expecting the IAC format, such as user type annotations and `borrowck`'s type ascription.
Fixes #151027
Fixes #138089
Fixes #138226
Fixes #150960
When an inherent associated const is marked with
#[type_const], its generics expect args in the format[Self, own_params...], similar to inherent associated types. However, HIR typeck'sinstantiate_value_pathwas constructing args in the regular associated const format[impl_params..., own_params...]. This mismatch caused ICEs when theargswere later used in contexts expecting the IAC format, such as user type annotations andborrowck's type ascription.