cargo
Rust cargo locate-project
Discover the workspace root manifest without guessing its path. The default output is JSON. Example format: shell. Run in a disposable copy of v16/fixtures/projects/workspace-demo. Expected result (not executed): A JSON object whose root points to workspace-demo/Cargo.toml. Common mistake: Treating the absolute path as a portable constant.
Formal Syntax & Structure
rust syntaxrust
cargo locate-project [OPTIONS]Working Example
Example Snippetrust
cargo locate-project --workspace