You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of rust-lang#66883 - eddyb:we-cant-have-nice-things, r=oli-obk
rustc_typeck: gate AnonConst's generics on feature(const_generics).
This PR employs the fix for rust-lang#43408 when `#![feature(const_generics)]` is enabled, making the feature-gate the opt-in for all the possible breakage this may incur.
For example, if this PR lands, this will cause a cycle error (due to rust-lang#60471):
```rust
#![feature(const_generics)]
fn foo<T: Into<[u8; 4]>>() {}
```
And so will anything with type-level const expressions, in its bounds.
Surprisingly, `impl`s don't seem to be affected (if they were, even libcore wouldn't compile).
One thing I'm worried about is not knowing how much unstable code out there, using const-generics, will be broken. But types like `Foo<{N+1}>` never really worked, and do after this PR, just not in bounds - so ironically, it's type-level const expressions that don't depend on generics, which will break (in bounds).
Also, if we do this, we'll have effectively blocked stabilization of const generics on rust-lang#60471.
r? @oli-obk cc @varkor@yodaldevoid@nikomatsakis
0 commit comments