Code
I tried this code:
struct Foo<const N: u32, const M: u64 = N>;
I expected to see this happen: It fail to compile like it uised to
Instead, this happened: it compile :>
Probably regressed in #125915 where we started lowering const arguments to ConstArgKind::Path instead of ConstArgKind::Anon so there is no longer implicitly an anon const with an expected type of u64 with an expr typed as u32.
We could probably special case handling of types of defaulted const generics in wfcheck to be done even when generics are involved. Or just accept this as working code which is consistent with things like struct Foo<T, U = <T as Iterator>::Item>(T, U); 馃し鈥嶁檧 would need a types fcp for that tho
I don't believe this to be a soundness bug
Code
I tried this code:
I expected to see this happen: It fail to compile like it uised to
Instead, this happened: it compile :>
Probably regressed in #125915 where we started lowering const arguments to
ConstArgKind::Pathinstead ofConstArgKind::Anonso there is no longer implicitly an anon const with an expected type ofu64with an expr typed asu32.We could probably special case handling of types of defaulted const generics in wfcheck to be done even when generics are involved. Or just accept this as working code which is consistent with things like
struct Foo<T, U = <T as Iterator>::Item>(T, U);馃し鈥嶁檧 would need a types fcp for that thoI don't believe this to be a soundness bug