Repository: rust
Issue: `generic_const_exprs` does not work properly with const/type param defaults
Labels: I-ICE,T-compiler,C-bug,S-blocked,A-const-generics,requires-nightly,F-generic_const_exprs,requires-incomplete-features

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
> ```rust
> 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.
> 
> ```rust
> 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 the `incomplete_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 on `generic_const_exprs` :sweat_smile:  
    

### duplicate issues

When this is fixed the following should be revisited and checked to make sure everything works as intended:

- [ ] [#106473 description](https://github.com/rust-lang/rust/issues/106473#issue-1519743404)
- [ ] [#106473 comment](https://github.com/rust-lang/rust/issues/106473#issuecomment-1373778123)
- [ ] [#101036 comment](https://github.com/rust-lang/rust/issues/101036#issuecomment-1228413898)
- [ ] [#101036 comment 2](https://github.com/rust-lang/rust/issues/101036#issuecomment-1345297071)
- [ ] [#94846 description](https://github.com/rust-lang/rust/issues/94846#issue-1166441076)
- [ ] [#93182 description](https://github.com/rust-lang/rust/issues/93182#issue-1111159495)
- [ ] [#105631 description](https://github.com/rust-lang/rust/issues/105631#issue-1492669743)
- [ ] [#111055 description](https://github.com/rust-lang/rust/issues/111055#issue-1690612999)
- [ ] [#111419 description](https://github.com/rust-lang/rust/issues/111419#issue-1703197021)
- [ ] [#117496 description](https://github.com/rust-lang/rust/issues/117496#issue-1973053401)