我有一个货物工作空间,有一间图书馆“/射线”和一个双筒“。 两名工作空间成员有不同的属地。
/raytracing/Cargo.toml:
[package]
name = "raytracer"
version = "0.1.0"
edition = "2021"
[dependencies]
rand = "0.8.5"
/cli/Cargo.toml:
[package]
name = "cli"
version = "0.1.0"
edition = "2021"
[dependencies]
raytracer = {path = "../raytracer"}
rand = "0.8.5"
rand_xorshift = "0.3.0"
父母名录 货物:toml(Cargo.toml)
[package]
edition = "2021"
name = "raytracing"
version = "0.1.0"
[workspace]
members = [
"raytracer",
"cli",
]
[[bin]]
path = "cli/src/main.rs"
name = "cli"
Compiling both the raytracer and cli packages using cargo build -p works, however in VSCode rust-analyzer complains about my dependencies in the ./cli package when I import them in main.rs: Error