Programming
rust
Rust language toolchain entry and compiler usage
Ubuntu
CentOS
Debian
SUSE
Fedora
RHEL
Arch
Alpine
macOS
Verified: 2026-05-13
Syntax
$rustc [options] <input>
Optionen
-O
--edition
-o
Examples
$rustc main.rs
$rustc -O main.rs
$rustc --edition=2021 main.rs
Typical use cases
?
Standard usage
rust --help
Note
Rust projects are usually built with cargo, while rustc is useful directly for focused compilation.
Export