cargo-rustc
Compile a Rust package. tldr-pages
On several platforms
Several platforms
Compile a Rust package. Similar to cargo build, but you can pass extra options to the compiler. See rustc --help for all available options.
Build the package and pass options to rustc
cargo rustc -- rustc_optionsIdentifyBuild artifacts in release mode, with optimizations
cargo rustc --releaseIdentifyCompile with architecture-specific optimizations for the current CPU
cargo rustc --release -- --codegen target-cpu=nativeIdentifyCompile with speed optimizations
cargo rustc -- --codegen opt-level=1IdentifyCompile with size optimizations (z also turns off loop vectorization)
cargo rustc -- --codegen opt-level=sIdentifyCheck if your package uses unsafe code
cargo rustc --lib -- -D unsafe-codeIdentifyBuild a specific package
cargo rustc --package packageIdentifyBuild only the specified binary
cargo rustc --bin nameIdentify