Description
In order to make feature(generic_const_exprs)
not completely broken when used with feature(const_generics_defaults)
, #86580 was landed. From the description of the PR:
This PR doesn't handle the predicates of the const so
trait Foo<const N: usize> { const Assoc: usize; } pub struct Bar<const N: usize = { <()>::Assoc }> where (): Foo<N>;Resolves to
<() as Foo<N>>::Assoc
which can allow for using fwd declared params indirectly.trait Foo<const N: usize> {} struct Bar<const N: usize = { 2 + 3 }> where (): Foo<N>;This code also ICEs under this PR because instantiating the default's predicates causes an ICE as predicates_of contains predicates with fwd declared params
because of this these two features are still pretty incompatible with eachother. This issue tracks this as there have been a large volume of issues that are all about which makes looking through F-generic_const-exprs
issues harder than it needs to be.
It was previously attempted to fix this in #106847 but that was closed:
I don't feel super comfortable merging more hacks to make
generic_const_exprs
+const_generics_defaults
work in the presence of each other. #86580 alone was already rather hacky and I think this PR just makes it way too much to be reasonable. It's also unclear to me whether this is going to interfere with fixing some of the other issues we have with const generics and I don't want to make that any harder than necessary.
feature(generic_const_exprs)
is an incomplete feature (both literally and according to theincomplete_features
lint), having it in a broken state because we are not currently in a good position to properly fix this seems fine to me. Thanks for making the PR anyway but I expect this issue will stay open until we make a lot more progress ongeneric_const_exprs
😅
duplicate issues
When this is fixed the following should be revisited and checked to make sure everything works as intended: