rust-analyzer: "error: extern location for does not exist"
After an upgrade to a newer rust-analyzer version (the one that happens to be in nixpkgs unstable) I’m now getting a lot of error messages like these when starting up rust-analyzer:
error: extern location for serde does not exist: /home/grfn/code/readyset/readyset/public/target/debug/deps/libserde-62e997496fa5b83d.rmeta
--> /home/grfn/.cargo/registry/src/github.com-1ecc6299db9ec823/mysql-22.0.0/src/lib.rs:834:1
|
834 | pub extern crate serde;
| ^^^^^^^^^^^^^^^^^^^^^^^
There’s a lot of those (I can post the full list if helpful) but it’s not the case for all crates.
No amount of cargo clean seems to be sufficient to fix this issue.
rust-analyzer version:
❯ rust-analyzer --version
rust-analyzer 2022-08-22
rustc version: (eg. output of rustc -V)
❯ rustc -V
rustc 1.64.0-nightly (fe3342816 2022-08-01)
relevant settings:
(setq lsp-rust-analyzer-cargo-watch-command "clippy"
lsp-rust-analyzer-cargo-watch-args ["--target-dir" "/home/grfn/code/readyset/readyset/target/rust-analyzer"])
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 17 (7 by maintainers)
What does this mean?
I am fairly certain this is caused by our rustc wrapper, setting
"rust-analyzer.cargo.buildScripts.useRustcWrapper": false,might fix it (at the cost of r-a reporting build scripts errors when the workspace doesn’t compile on start up).