所以我在一个大项目上有这个 toml:
[package]
name = "semperengine"
version = "0.1.0"
edition = "2021"
[lib]
name = "semperengine"
path = "src/lib.rs"
[dependencies]
rand_pcg = "0.3.1"
rand = "0.8.5"
image = "0.24.3"
cfg-if = "1.0.0"
# internal
algebra = { path = "crates/algebra" }
builder = { path = "crates/builder" }
camera = { path = "crates/camera" }
chicken_wire = { path = "crates/chicken_wire" }
dual_contouring = { path = "crates/dual_contouring/" }
geometry = { path = "crates/geometry" }
hedge = { path = "crates/hedge" }
iterators = { path = "crates/iterators" }
ne_core = { path = "crates/ne_core" }
ne_gui = { path = "crates/ne_gui" }
noise = { path = "crates/noise" }
numerical_analysis = { path = "crates/numerical_analysis" }
peripherals = { path = "crates/peripherals" }
pga = { path = "crates/pga" }
topology = { path = "crates/topology" }
thread_pool = { path = "crates/thread_pool" }
vulkan_bindings = { path = "crates/vulkan_bindings" }
当我运行cargo buld 时,我得到这个:
error: no matching package named `thread_pool` found
location searched: /home/makogan/rust_never_engine/crates/thread_pool
required by package `semperengine v0.1.0 (/home/makogan/rust_never_engine)`
但是板条箱存在:
ls /home/makogan/rust_never_engine/crates/thread_pool/
benches Cargo.lock Cargo.toml flamegraph.svg out.txt perf.data perf.data.old src target
为什么货物可以找到所有其他板条箱,却找不到特定的板条箱?
发生这种情况是因为板条箱
thread_pool
曾经被称为experimental_thread_pool
。重构 Cargo.toml
的 thread_pool
文件后仍然有:
[package]
name = "experimental_thread_pool"
version = "0.1.0"
edition = "2021"
修正为
[package]
name = "thread_pool"
version = "0.1.0"
edition = "2021"
解决了问题。