Skip to content

Intermittent "feature cannot be used on stable release channel" #526

Open

Description

@jyn514

I temporarily got this error trying to build rustix as a dependency:

error[E0554]: `#![feature]` may not be used on the stable release channel
--> /Users/jyn/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/rustix-0.36.4/src/lib.rs:99:26
   |
99 | #![cfg_attr(rustc_attrs, feature(rustc_attrs))]
   |                          ^^^^^^^^^^^^^^^^^^^^

I have unfortunately not been able to reproduce this error; I updated the version of rustix, which I originally thought fixed the issue, but when I downgraded to 0.36.4 I couldn't reproduce it again.

I think the build script needs to have rerun-if-env-changed=RUSTC or something like that? If it helps, my default toolchain is nightly but I have a rust-toolchain file that says to use 1.65.

Activity

  1. jyn514 commented on Jan 25, 2023

    @jyn514
    Author
  2. intgr commented on Jan 30, 2023

    @intgr

    FWIW running rm -rf target to delete the cache fixed this issue for me.

  3. p-kraszewski commented on Feb 24, 2023

    @p-kraszewski

    I have this very error popping in my various projects (95% of the time related to rustix). A simple cargo clean is a fix, but it forces me to fully recompile big projects, which is slightly annoying.

    Sometimes just adding a new dependency to my projects triggers it.

  4. sunfishcode commented on Feb 24, 2023

    @sunfishcode
    Member

    I submitted #544 in hopes that it may help. However, I don't yet have a reliable way to reproduce the problem locally, so I can't say for sure whether it does.

  5. jyn514 commented on Feb 24, 2023

    @jyn514
    Author

    I have this very error popping in my various projects (95% of the time related to rustix). A simple cargo clean is a fix, but it forces me to fully recompile big projects, which is slightly annoying.

    @p-kraszewski as a workaround, you can use cargo clean -p rustix to only recompile rustix instead of all your dependencies

  6. sunfishcode commented on Mar 3, 2023

    @sunfishcode
    Member

    #544, which may fix this, is now released in version 0.37.

  7. sunfishcode commented on Mar 29, 2023

    @sunfishcode
    Member

    Does anyone who encountered this issue continue to see it with 0.37, or 0.36.11?

  8. p-kraszewski commented on Mar 29, 2023

    @p-kraszewski

    Not encountered within at least the last 2 weeks. Thank you.

  9. mschneider commented on Apr 8, 2023

    @mschneider

    just encountered it with rustix 0.37.7

  10. 5 remaining items

  11. Luthaf commented on Jun 30, 2023

    @Luthaf

    I just saw an instance of the same issue with rustix v0.37.20. rm -rf target fixed it, but I'm not sure how to reproduce. Might have been related to me starting a build simultaneously from the command line and from inside vscode with rust-analyzer.

  12. JohnDowson commented on Jul 26, 2023

    @JohnDowson

    Encountered this with rustix-0.38.4

  13. ynhame commented on Oct 3, 2023

    @ynhame

    This did also happen to me on 0.37.24.
    The only thing I did was a cargo update followed by a cargo clippy.
    As mentioned above doing cargo clean -p rustix solved the issue.

  14. ptdecker commented on Oct 4, 2023

    @ptdecker

    Encountered this with rustix-0.38.4.

    Here is a partial cargo tree of my project indicating which of my dependencies are using this package:

    [corporate project]
    ├── reqwest v0.11.20
    │   ├── hyper-tls v0.5.0
    │   │   ├── native-tls v0.2.11
    │   │   │   └── tempfile v3.7.0
    │   │   │       └── rustix v0.38.4
    └── [corporate private module]
        ├── criterion v0.5.1
        │   ├── is-terminal v0.4.9
        │   │   └── rustix v0.38.4 (*)
    
  15. benjaminleonard commented on Oct 10, 2023

    @benjaminleonard

    Ran into this issue with rustix 0.37.23 – after a fresh install. Fixed by running: cargo clean -p rustix

  16. theRookieCoder commented on Feb 20, 2024

    @theRookieCoder

    Encountered this with rustix 0.37.27, cargo clean and deleting the target directory does not fix it for me. This only happens on rust analyzer for some reason (yes I did restart the server and vs code too), compiling from the command line works perfectly fine.

  17. spitfire05 commented on Feb 20, 2024

    @spitfire05

    This seems unrelated to rust-analyzer itself, the thing is, using stable rust a project referencing rustix will fail with this error on cargo check (or cargo clippy), but build fine w/o errors on cargo build. Strange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions