forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#66883 - eddyb:we-cant-have-nice-things, r=o…
…li-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
- Loading branch information
Showing
2 changed files
with
41 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters