-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On stable channels, suggest removing #![feature]
s that have already been stabilized
#83715
Comments
|
I think the compiler should suggest removing the feature gate if it's been stabilized. |
I see, I was unsure whether the error message was referring to the referred feature or the feature flag itself (since the example code of the stabilize PR was using it too I was assuming the former). And yes, removing the feature line from the example code makes it compile, thanks. Is there any way to make rustc ignore the feature flag and try to compile it anyway? The crate I want to use still has it included and I'd prefer not having to remove it manually until it gets removed upstream. (re-opening since @jyn514 seems to think its a valid issue/suggestion) |
No, you'll need to either patch the crate or fix it upstream. |
#![feature]
s that have already been stabilized
On stable, suggest removing `#![feature]` for features that have been stabilized I don't know how to test this (https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Run.20tests.20without.20enabling.20nightly.20features.3F). I confirmed locally that this gives the appropriate help with `channel = "beta"`: ``` error[E0554]: `#![feature]` may not be used on the beta release channel --> src/lib.rs:2:1 | 2 | #![feature(min_const_generics)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the attribute | = help: the feature `min_const_generics` has been stable since 1.51.0 and no longer requires an attribute to enable error[E0554]: `#![feature]` may not be used on the beta release channel --> src/lib.rs:3:1 | 3 | #![feature(min_const_generics, min_specialization)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: the feature `min_const_generics` has been stable since 1.51.0 and no longer requires an attribute to enable error[E0554]: `#![feature]` may not be used on the beta release channel --> src/lib.rs:4:1 | 4 | #![feature(box_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ ``` Closes rust-lang#83715.
On stable, suggest removing `#![feature]` for features that have been stabilized I don't know how to test this (https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Run.20tests.20without.20enabling.20nightly.20features.3F). I confirmed locally that this gives the appropriate help with `channel = "beta"`: ``` error[E0554]: `#![feature]` may not be used on the beta release channel --> src/lib.rs:2:1 | 2 | #![feature(min_const_generics)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the attribute | = help: the feature `min_const_generics` has been stable since 1.51.0 and no longer requires an attribute to enable error[E0554]: `#![feature]` may not be used on the beta release channel --> src/lib.rs:3:1 | 3 | #![feature(min_const_generics, min_specialization)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: the feature `min_const_generics` has been stable since 1.51.0 and no longer requires an attribute to enable error[E0554]: `#![feature]` may not be used on the beta release channel --> src/lib.rs:4:1 | 4 | #![feature(box_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ ``` Closes rust-lang#83715.
On stable, suggest removing `#![feature]` for features that have been stabilized I don't know how to test this (https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Run.20tests.20without.20enabling.20nightly.20features.3F). I confirmed locally that this gives the appropriate help with `channel = "beta"`: ``` error[E0554]: `#![feature]` may not be used on the beta release channel --> src/lib.rs:2:1 | 2 | #![feature(min_const_generics)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the attribute | = help: the feature `min_const_generics` has been stable since 1.51.0 and no longer requires an attribute to enable error[E0554]: `#![feature]` may not be used on the beta release channel --> src/lib.rs:3:1 | 3 | #![feature(min_const_generics, min_specialization)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: the feature `min_const_generics` has been stable since 1.51.0 and no longer requires an attribute to enable error[E0554]: `#![feature]` may not be used on the beta release channel --> src/lib.rs:4:1 | 4 | #![feature(box_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ ``` Closes rust-lang#83715.
On stable, suggest removing `#![feature]` for features that have been stabilized I don't know how to test this (https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Run.20tests.20without.20enabling.20nightly.20features.3F). I confirmed locally that this gives the appropriate help with `channel = "beta"`: ``` error[E0554]: `#![feature]` may not be used on the beta release channel --> src/lib.rs:2:1 | 2 | #![feature(min_const_generics)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the attribute | = help: the feature `min_const_generics` has been stable since 1.51.0 and no longer requires an attribute to enable error[E0554]: `#![feature]` may not be used on the beta release channel --> src/lib.rs:3:1 | 3 | #![feature(min_const_generics, min_specialization)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: the feature `min_const_generics` has been stable since 1.51.0 and no longer requires an attribute to enable error[E0554]: `#![feature]` may not be used on the beta release channel --> src/lib.rs:4:1 | 4 | #![feature(box_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ ``` Closes rust-lang#83715.
On stable, suggest removing `#![feature]` for features that have been stabilized I don't know how to test this (https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Run.20tests.20without.20enabling.20nightly.20features.3F). I confirmed locally that this gives the appropriate help with `channel = "beta"`: ``` error[E0554]: `#![feature]` may not be used on the beta release channel --> src/lib.rs:2:1 | 2 | #![feature(min_const_generics)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the attribute | = help: the feature `min_const_generics` has been stable since 1.51.0 and no longer requires an attribute to enable error[E0554]: `#![feature]` may not be used on the beta release channel --> src/lib.rs:3:1 | 3 | #![feature(min_const_generics, min_specialization)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: the feature `min_const_generics` has been stable since 1.51.0 and no longer requires an attribute to enable error[E0554]: `#![feature]` may not be used on the beta release channel --> src/lib.rs:4:1 | 4 | #![feature(box_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ ``` Closes rust-lang#83715.
On stable, suggest removing `#![feature]` for features that have been stabilized I don't know how to test this (https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Run.20tests.20without.20enabling.20nightly.20features.3F). I confirmed locally that this gives the appropriate help with `channel = "beta"`: ``` error[E0554]: `#![feature]` may not be used on the beta release channel --> src/lib.rs:2:1 | 2 | #![feature(min_const_generics)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the attribute | = help: the feature `min_const_generics` has been stable since 1.51.0 and no longer requires an attribute to enable error[E0554]: `#![feature]` may not be used on the beta release channel --> src/lib.rs:3:1 | 3 | #![feature(min_const_generics, min_specialization)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: the feature `min_const_generics` has been stable since 1.51.0 and no longer requires an attribute to enable error[E0554]: `#![feature]` may not be used on the beta release channel --> src/lib.rs:4:1 | 4 | #![feature(box_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ ``` Closes rust-lang#83715.
I was under the impression that
min_const_generics
should work on stable channel with version 1.51, however using the example code from #79135 I getrustc -Vv output (its the mingw package):
The text was updated successfully, but these errors were encountered: