-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Unresolved import only in lib.rs, but not main.rs - circular dev dependency failure #9574
Comments
Ah, I use this crate is a dev-dependency in my "core" crate - when I remove this RA is happy again. I guess there's an issue with circular dependencies through dev-dependencies. |
You should try to update the |
This still happens for me, on rust version 1.61.0-nightly (10913c000 2022-03-03) and rust-analyzer vscode extension version: 9d473a0 2022-03-04 nightly. |
still happens at rust-analyzer version: 1.65.0-nightly (015a824 2022-08-22) I guess this affects wide range of projects, wish it be fixed some time. |
Fixes rust-lang#9574 Fixes rust-lang#11410 `rust-analyzer` already counts all of the different targets of a crate as different crates, so it was pretty easy to just exclude dev dependencies from the dependency lists of the targets other than test, dev and bench when ingesting `cargo metadata`'s output. A similar thing is already done for build dependencies. It's possible there might be something I'm missing here, since this is quite a long-standing issue which I expected to be much more complicated to solve; but, this seems to work. The circular dependency errors that `rust-analyzer` used to throw on `wasm-bindgen` went away after switching to this patched version.
Closing in favor of #14167 |
I'm trying to import a crate from the same workspace and the import fails in the
lib.rs
file but not themain.rs
file. I can't seem to fix the issue, IEcargo clean
doesn't fix it, and the issue persists between restarts.My
Cargo.toml
:And the issues side-by-side
Any idea on how the bust the cache to get RA working again?
The text was updated successfully, but these errors were encountered: