-
Notifications
You must be signed in to change notification settings - Fork 1.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
std::thread::LocalKey not found #16486
Comments
This is a known issue as rust-analyzer can't analyze the standard libraries crates-io dependencies by default, so the cfg-if macro is unresolved and hence not expanded. You can fix this by either somehow introducing cfg-if into your dependency graph which will make r-a hackily inject it into the standard library dependencies or enable the experimental |
If |
It seems that this doesn't work. I need to introduce cfg-if dependencies in my own project to solve all of this |
Oh, right, see #16387. We try to run Something like this will fix it, for better or worse: "rust-analyzer.server.extraEnv": {
"__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS": "nightly"
} Closing as a duplicate of #7637. |
internal: Set channel override when querying the sysroot metadata This is pretty hard to discover, and makes the setting useless, we should probably enable it for now. CC #16486
src/main.rs
completion list
run
cargo check
0 warnings, 0 errorspatch
~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs
use rust-analyzer Expand macro
After the patch, the behavior was as expected, but it seems that this issue cannot be reproduced well
OS:
Linux Acer-Lrne 6.5.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 06 Sep 2023 21:01:01 +0000 x86_64 GNU/Linux
rust-analyzer version: rust-analyzer 1.75.0 (82e1608 2023-12-21) and rust-analyzer 1.78.0-nightly (b11fbfb 2024-02-03)
rustc version: rustc 1.75.0 (82e1608df 2023-12-21) and rustc 1.78.0-nightly (b11fbfbf3 2024-02-03)
relevant settings: NONE
The text was updated successfully, but these errors were encountered: