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

cfg_attr falsely evaluated? #13019

Closed
9SMTM6 opened this issue Aug 14, 2022 · 2 comments
Closed

cfg_attr falsely evaluated? #13019

9SMTM6 opened this issue Aug 14, 2022 · 2 comments

Comments

@9SMTM6
Copy link

9SMTM6 commented Aug 14, 2022

I may be a bit out of my dept, this is my interpretation.

But to me it seems like RA doesnt handle cfg_attr correctly, specifically I'm getting errors about using a nightly feature (the feature flag attribute:-)) in RA, when running cargo build doesnt fail.

I was able to observe this on Windows, with both the 1.63 and 1.62 toolchain, specifically when trying out uniffi_build.

It is reproducible just by following the tutorial until you use uniffi_build, and I get an error from the transitive anyhow dependency in the RA LSP log from VSCode:

[ERROR rust_analyzer::lsp_utils] failed to run build scripts

error[E0554]: `#![feature]` may not be used on the stable release channel
   --> C:\Users\<USER>\.cargo\registry\src\github.com-1ecc6299db9ec823\anyhow-1.0.61\src\lib.rs:214:32
    |
214 | #![cfg_attr(backtrace, feature(backtrace))]
    |                                ^^^^^^^^^

From my cursory browsing the backtrace feature should not be enabled in anyhow, it should be disabled by default and uniffi_build doesnt enable it.

As I said, running cargo build runs the build-script just fine.

rust-analyzer version: 0.3.1162-standalone (634cfe3 2022-08-07)

rustc version: both 1.63 and 1.62 tested

relevant settings: -

@bjorn3
Copy link
Member

bjorn3 commented Aug 14, 2022

Fixed by #13010, which will be in the release tomorrow. You will need to do a cargo clean once to erase the corrupt state that rust-analyzer before this PR caused.

@9SMTM6
Copy link
Author

9SMTM6 commented Aug 14, 2022

ah, i did search for connected issues, but did not connect these.

I will reopen should this not clear things up, thanks!

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

No branches or pull requests

2 participants