-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Fix ICE in normalizing inherent associated consts with #[type_const]
#152000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
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 |
…uwer Rollup of 6 pull requests Successful merges: - #151590 (cmse: don't use `BackendRepr` when checking return type) - #151945 (feat: Add `NonZero::<T>::from_str_radix`) - #152000 (Fix ICE in normalizing inherent associated consts with `#[type_const]`) - #152192 (Always use Xcode-provided Clang in macOS CI) - #152196 (bootstrap: Remove `ShouldRun::paths`) - #152222 (Re-add TaKO8Ki to triagebot review queue)
Rollup merge of #152000 - lapla-cogito:ice_151027, r=BoxyUwU Fix ICE in normalizing inherent associated consts with `#[type_const]` 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'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.