cargo-rustc

Compile a Rust package, and pass extra options to the compiler.

TLDR

Build the package or packages defined by the Cargo.toml manifest file in the current working directory

$ cargo rustc
copy

Build artifacts in release mode, with optimizations

$ cargo rustc --release
copy

Compile with architecture-specific optimizations for the current CPU

$ cargo rustc --release -- -C target-cpu=native
copy

Compile with speed optimization

$ cargo rustc -- -C opt-level [1|2|3]
copy

Compile with [s]ize optimization (z also turns off loop vectorization)

$ cargo rustc -- -C opt-level [s|z]
copy

Check if your package uses unsafe code

$ cargo rustc --lib -- -D unsafe-code
copy

Build a specific package

$ cargo rustc --package [package]
copy

Build only the specified binary

$ cargo --bin [name]
copy

Copied to clipboard
free 100$ digital ocean credit