Open swanandx opened 2 years ago
Complete restart of VSCode solved the unresolved import error, but it should have worked without needing to restart/reload it as soon as I added the [lib]
in Cargo.toml
right?
Hi @swanandx,
I've been experiencing a similar "Unresolved import" error after adding lib.rs
to my project. I came across an interesting Stack Overflow article that provided some insights on how to resolve this issue.
I have a
lib.rs
file, which has thepub async fn run()
function, but when I try to import it, rust-analyzer shows unresolved import error. But it doesn't show any errors incargo check
/clippy
, and it also builds successfully!Here is my
Cargo.toml
file:rust-analyzer version: 4e72700e3 2022-02-28 stable
rustc version: rustc 1.59.0 (9d1b2106e 2022-02-23)