I'm trying to troubleshoot
rust-analyzer reporting "unresolved import".
In the past, it's reported that
heapless doesn't exist. Now it sometimes reports
num_traits doesn't exist. Both of these crates exist in the
Cargo.toml, and the crate builds fine, but somehow
rust-analyzer isn't reflecting that.
To make things even weirder, I decided to try cloning the repo so I could post this question, and I get different behavior. Namely, my unmodified working copy can't find
num_traits, while the freshly-cloned one can't find
heapless (fresh clone on the left, working one on the right):
The command I'm using to clone is:
git clone -b xous-ipc-refactor https://github.com/betrusted-io/xous-core.git
Right now the failing crate is in
services/xous-names, however I've had various failures over the past few months.
Some things to note:
- There is a
.vscode/settings.jsonthat sets the default target to
- My global settings don't have anything related to Rust
- Sometimes I see different results when using WSL. For example, right now Windows is showing
num_traitsas being unresolved, whereas WSL is showing
heaplessas being unresolved.
What causes "unresolved import" and how can I track down what the issue is?