Skip to content
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

error[E0554]: #![feature] may not be used on the stable release channel #51

Closed
Turbo87 opened this issue Nov 9, 2022 · 9 comments · Fixed by #53
Closed

error[E0554]: #![feature] may not be used on the stable release channel #51

Turbo87 opened this issue Nov 9, 2022 · 9 comments · Fixed by #53

Comments

@Turbo87
Copy link

Turbo87 commented Nov 9, 2022

through clap -> terminal_size -> rustix -> io-lifetimes we are using this crate in the crates.io codebase. rust-lang/crates.io#5436 had updated the lockfile, causing us to upgrade from v0.7.4 to 0.7.5. rustix was also updated from v0.35.12 to v0.35.13 at the same time.

after this update I'm no longer able to compile the codebase locally on macOS:

$ cargo check
    Checking io-lifetimes v0.7.5
error[E0554]: `#![feature]` may not be used on the stable release channel
  --> /Users/tbieniek/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-0.7.5/src/lib.rs:31:26
   |
31 | #![cfg_attr(rustc_attrs, feature(rustc_attrs))]
   |                          ^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0554`.
error: could not compile `io-lifetimes` due to previous error

note that on CI and the production servers the codebase compiles and runs fine for some reason. any clue what might be causing this?

@sunfishcode
Copy link
Owner

The only other cases I've seen of this ended up being due to the build.rs script not getting rerun when it should. A cargo clean has fixed it in those cases. Could you check whether cargo clean fixes it for you too?

Alternatively, if you're able to reproduce the conditions under which the target directory gets into this state, or if you have any other info about your build configuration, please post it, as it may help identify the underlying cause.

@Turbo87
Copy link
Author

Turbo87 commented Nov 16, 2022

hmm, interestingly rust-lang/crates.io#5471 worked fine locally and on CI, so maybe you're right and it is buildscript related 🤔

@kornelski
Copy link

I've ran into this too after upgrading env_logger to 0.10

@karcsesz
Copy link

karcsesz commented Nov 25, 2022

Ran into the same error when updating from env_logger 0.9.3 to 0.10.0 while using CLion. A cargo clean and a rebuild fixed the issue.

I was able to reproduce the error by rolling env_logger back to 0.9.3, running a clean rebuild (cargo clean && cargo build), upgrading to 0.10.0, syncing the project through CLion, and building without cleaning.
If I just run cargo build without syncing through the IDE, it compiles without an issue.

Error message just in case:

error[E0554]: `#![feature]` may not be used on the stable release channel
  --> /home/karcsesz/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/lib.rs:31:26
   |
31 | #![cfg_attr(rustc_attrs, feature(rustc_attrs))]
   |                          ^^^^^^^^^^^^^^^^^^^^

Something of note is that env_logger used atty instead of is-terminal before 0.10.0.

@Turbo87
Copy link
Author

Turbo87 commented Nov 25, 2022

just to add to that datapoint, I'm using IntelliJ with the Rust plugin, so maybe that is indeed related

@kornelski
Copy link

kornelski commented Nov 25, 2022

@sunfishcode Maybe you could make a release of io-lifetimes that renames the cfg var to anything else, just to avoid the stale cached config breaking users of env_logger?

I have cleared my target/ dir, but I worry downstream users of my library are all going to run into the same problem when they get new env_logger. Errors about nightly features are confusing and it's not obvious it's a caching issue.

sunfishcode added a commit that referenced this issue Nov 25, 2022
This io-lifetimes crate no longer needs this rustc_attrs code. On Rust
versions where io_safety is stabilized, we use the version in std (which
uses rustc_attrs internally). On Rust versions where it's not, rustc_attrs
isn't available to user code anyway, since it's not a stable language
feature.

This might fix #51.
sunfishcode added a commit that referenced this issue Nov 25, 2022
@sunfishcode
Copy link
Owner

@kornelski That's a good idea; I've now posted #53 which renames the cfg variable. I also noticed that I can actually remove all the rustc_attrs code altogether now. It was needed before io_safety was stabilized, but that's done now, so I can just delete those parts now. Hopefully one of these two changes will fix this issue.

sunfishcode added a commit that referenced this issue Nov 25, 2022
* Remove use of `rustc_attrs`, which is no longer needed.

This io-lifetimes crate no longer needs this rustc_attrs code. On Rust
versions where io_safety is stabilized, we use the version in std (which
uses rustc_attrs internally). On Rust versions where it's not, rustc_attrs
isn't available to user code anyway, since it's not a stable language
feature.

This might fix #51.

* Rename `io_lifetimes_use_std` to `io_safety_is_in_std`.

This may also help fix #51.
@sunfishcode sunfishcode reopened this Nov 25, 2022
@sunfishcode
Copy link
Owner

#53 is now released in 1.0.2.

@sunfishcode
Copy link
Owner

I haven't heard any further reports off this error. And the line of code that generates the error message is no longer in the tree, so if the problem somehow does persst, it'll at least have a different error message, so I'll close this issue now. If anyone encounters any problems, please file a new issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants