I have a binary dependency dep.rlib
, without any code sources. (I'm sure it's compiled with same rustc as mine, thus no abi problem.)
I write such code
extern crate dep;
fn main() {
// do some stuff with dep::some_method.
}
Then compile it with RUSTFLAGS="--extern dep=path/to/the/rlib" cargo run
and it works fine.
I learn that the exported items are written into rmeta
and contained in rlib so it works. However rust-analyzer always report unresolved extern crate
. Setting cargo.extraEnv
, server.extraEnv
, check.extraEnv
all does not help.
How could rust-analyzer solves the dependency and enables completion?