rust-analyzer
rust-analyzer copied to clipboard
Unresolved import only in lib.rs, but not main.rs - circular dev dependency failure
I'm trying to import a crate from the same workspace and the import fails in the lib.rs
file but not the main.rs
file. I can't seem to fix the issue, IE cargo clean
doesn't fix it, and the issue persists between restarts.
My Cargo.toml
:
[package]
name = "dioxus-hooks"
version = "0.0.0"
edition = "2018"
[dependencies]
dioxus-core = { path = "../core"}
And the issues side-by-side

Any idea on how the bust the cache to get RA working again?
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 rustc
to the latest version. I had the same problem before, but after I upgrade the rustc
and it fixed.
This still happens for me, on rust version 1.61.0-nightly (10913c000 2022-03-03) and rust-analyzer vscode extension version: 9d473a0b9 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.
Closing in favor of https://github.com/rust-lang/rust-analyzer/issues/14167