Handle primitive constants in const arguments for MGCA#158590
Handle primitive constants in const arguments for MGCA#158590chenyukang wants to merge 1 commit into
Conversation
|
|
|
lol that's a really funny bug 🤔 this fix feels slightly off to me though, i would generally like for the distinction between anon const and direct repr to be quite obvious/simple and this complicates that with a special case about the exact way the path looks 🤔 it is weird to me that we fail to resolve the associated constant in the first place (even with inherent_associated_types enabled!). do you have a sense of why HIR ty lowering doesn't resolve the associated constant? if there's some special casing in normal lookup of associated constants in HIR typeck that isn't present in HIR ty lowering then we probably want to replicate it in HIR ty lowering so that we do succeed in resolving the associated constant when it's directly represented thx for looking into this @rustbot author |
Normal expression lookup resolves HIR ty lowering direct const path missing this part, here we only call so primitive type fail through to |
|
☔ The latest upstream changes (presumably #159046) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
MGCA direct const arg lowering bypasses expression primitive fallback for paths like
u8::MAX, so they are treated as ambiguous type-level associated constants instead of primitive associated constants.Fixes #158506
r? @BoxyUwU
link #149136