cargo

Rust cargo rustc

Forward an extra compiler argument to one selected target. Here the library target is explicit, and the extra flag asks for metadata output. Example format: shell. Run in a disposable copy of v16/fixtures/projects/profile-demo. Expected result (not executed): Successful compiler invocation for the library; artifact naming is not assumed. Common mistake: Passing extra flags with multiple selected targets or expecting dependencies to receive them.

Formal Syntax & Structure

rust syntaxrust
cargo rustc [OPTIONS]

Working Example

Example Snippetrust
cargo rustc --offline --lib -- --emit=metadata
Rust Reference