-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
"#![feature] may not be used on the stable release channel" #250
Comments
Confirming this issue. |
There are two changes between 1.0.59 and 1.0.60. Could you try these two and report which one reproduces the issue? [dependencies]
anyhow = "1.0.59"
[patch.crates-io]
anyhow = { git = "https://github.com/dtolnay/anyhow", rev = "abe9d3c429c0df113c52fd0ee5b074402746f50b" } [dependencies]
anyhow = "1.0.59"
[patch.crates-io]
anyhow = { git = "https://github.com/dtolnay/anyhow", rev = "5fbf4eda3a9e7392f00fbb4ccaa216a108025f64" } |
Hmm, both revisions build without problems:
|
See dtolnay/anyhow#250 Signed-off-by: Oliver Gould <[email protected]>
See dtolnay/anyhow#250 Signed-off-by: Oliver Gould <[email protected]>
1.0.60 builds correctly with Rust 1.62.1 (stable): https://github.com/boa-dev/boa/runs/7662862271?check_suite_focus=true If the |
I cannot reproduce this, is there anything else in your setup that might affect this? Could you share the full
Also please share your verbose version information:
Do you have the |
But I now cannot reproduce this anymore either. I don’t know what happened. I created a new empty project, then added Then I removed all the other dependencies (but I guess something could remain in my Then I searched through the issues here and decided it must be something with the version. But maybe it was something one of the other dependencies did to my EDIT:
|
Hm yes that is odd. Lockfiles AFAIK don't affect feature resolution so I don't see how there could be anything left in your lockfile that would cause this problem. If you can replicate this situation again:
That would probably be helpful. |
I had the same issue, after deleting my |
So maybe it is some issue with build script output being cached? |
There is an annoying bug in 1.60 that prevents rust-analyzer from generating proc macros. See dtolnay/anyhow#250
There is an annoying bug in 1.60 that prevents rust-analyzer from generating proc macros. See dtolnay/anyhow#250
Same issue here. This happened once, but was not reproducible after I deleted the |
I also ran into this after upgrading to anyhow 1.0.60 today: error[E0554]: `#![feature]` may not be used on the stable release channel
--> /Users/djc/.cargo/registry/src/github.com-1ecc6299db9ec823/anyhow-1.0.60/src/lib.rs:214:32
|
214 | #![cfg_attr(backtrace, feature(backtrace))]
| ^^^^^^^^^ According to The output from Running `rustc --crate-name anyhow --edition=2018 /Users/djc/.cargo/registry/src/github.com-1ecc6299db9ec823/anyhow-1.0.60/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=1 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=e0e05d09e32292b9 -C extra-filename=-e0e05d09e32292b9 --out-dir /Users/djc/src/bolt/rust/gcp/target/debug/deps -L dependency=/Users/djc/src/bolt/rust/gcp/target/debug/deps --cap-lints allow --cfg backtrace`
Running `rustc --crate-name anyhow --edition=2018 /Users/djc/.cargo/registry/src/github.com-1ecc6299db9ec823/anyhow-1.0.60/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=1 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=67e3df9d0ec0a44b -C extra-filename=-67e3df9d0ec0a44b --out-dir /Users/djc/src/bolt/rust/gcp/target/debug/deps -L dependency=/Users/djc/src/bolt/rust/gcp/target/debug/deps --cap-lints allow --cfg backtrace` Which does have |
For anyone running into this with I think the problem is that we set This approach was inspired by IntelliJ Rust, which I suspect is also affected. We have an option to disable this hack, |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
oh, yes that would explain it. If you always return exit code 0 then that would fool all the auto-detect in all the crates. Is there a rust-analyzer issue tracking this? Also has 1.0.60 been un-yanked? I didn't even know that is possible... |
No, just an option you can use to disable it. From RA's point of view, this is a feature because it speeds up project loading. I don't think we've ever spotted another crate doing feature detection like this. |
It's IMO clearly a bug if you claim to a build script probe that compilation succeded. This is certainly not the only crate doing that; others include eyre, and there even is autocfg (14 million "recent" downloads on crates.io) to make it easy for crates to have such "probes" for particular features. |
Reported as rust-lang/rust-analyzer#12973. I think this can be closed on the anyhow side. |
See dtolnay/anyhow#250 The `backtrace` feature is unified against the various anyhow versions we use.
See dtolnay/anyhow#250 The `backtrace` feature is unified against the various anyhow versions we use.
Closing in favor of rust-lang/rust-analyzer#12973, since this is quite clearly a rust-analyzer bug based on the discussion above. |
See dtolnay/anyhow#250 The `backtrace` feature is unified against the various anyhow versions we use.
Btw, turns out the reason that only anyhow is affected (and only starting in 1.0.60) is that it respects RUSTC_WRAPPER, which eyre and autocfg don't do. |
For the time being, IMO some note in the README and/or the docs about the issue could be helpful – so that people encountering it can easily find out they should run |
As a work-around we could also remove the use of RUSTC_WRAPPER. Since that works fine for autocfg and eyre, it is unlikely to lead to problems. |
the workspace-hack from cargo-hakari unifies the versions we use to a major version number (1) => we hit dtolnay/anyhow#250 This removes the `backtrace` feature.
the workspace-hack from cargo-hakari unifies the versions we use to a major version number (1) => we hit dtolnay/anyhow#250 This removes the `backtrace` feature.
the workspace-hack from cargo-hakari unifies the versions we use to a major version number (1) => we hit dtolnay/anyhow#250 This removes the `backtrace` feature.
Agree with the comment above, not sure if this is a good solution, but as a temporary option, this worked for me: rm -rf target
cargo check |
See dtolnay/anyhow#250 The `backtrace` feature is unified against the various anyhow versions we use.
See dtolnay/anyhow#250 The `backtrace` feature is unified against the various anyhow versions we use.
See dtolnay/anyhow#250 The `backtrace` feature is unified against the various anyhow versions we use.
See dtolnay/anyhow#250 The `backtrace` feature is unified against the various anyhow versions we use.
Please forgive me if I'm mistaken, but was this issue meant to be bypassed by the above PRs? I just ran into it on anyhow 1.0.66. It started happening after I created some cargo workspaces. Deleting target/ still fixes the issue thankfully. Edit: I just saw rust-lang/rust-analyzer#12973 and it seems this issue should be fixed on the rust-analyzer end anyway? It happened on 1.64.0 so unless the fix didn't make it into that stable version I'm quite confused. I'll see if I can repro the issue again and may take it up with them |
It was fixed a long time ago. At this point we are just keeping the "I use 4-month-old rust-analyzer (or intellij) because I enjoy hitting bugs that were already fixed in those projects 3 months ago" crowd entertained, so I'll lock this issue from further discussion at this point. |
When starting a brand new project and adding
anyhow = "1.0"
oranyhow = "=1.0.60"
to the dependencies, the build/check fails with:It passes with
anyhow = "=1.0.59"
though.Using:
The text was updated successfully, but these errors were encountered: