mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-30 04:56:25 +03:00
a9b4c7cfc9
Fix ICE in normalizing inherent associated consts with `#[type_const]` Fixes rust-lang/rust#151027 Fixes rust-lang/rust#138089 Fixes rust-lang/rust#138226 Fixes rust-lang/rust#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.
For more information about how rustc works, see the rustc dev guide.