cargo-manifest

Rust Workspace dependency inheritance

Inherit the dependency declaration from workspace.dependencies. The root sets the path relative to the workspace root. Example format: toml. Run in a disposable copy of v16/fixtures/projects/workspace-demo. Expected result (not executed): cargo run --offline --quiet -p app prints 21. Common mistake: Assuming a root declaration automatically adds the dependency to every member.

Formal Syntax & Structure

rust syntaxrust
[dependencies]

Working Example

Example Snippetrust
[dependencies]pricing.workspace = true
Rust Reference