The Rust compiler. Rust projects usually use
cargoinstead of invokingrustcdirectly. More information: https://doc.rust-lang.org/rustc.
rustc path/to/main.rs
s means optimize for binary size; z is the same with even more optimizations):rustc -C lto -C opt-level=0|1|2|3|s|z path/to/main.rs
rustc -g path/to/main.rs
rustc --explain error_code
rustc -C target-cpu=native path/to/main.rs
rustup first to be able to compile for it):rustc --print target-list
rustc --target target_triple path/to/main.rs