RUSTC(1) User Commands RUSTC(1) (NAME) rustc - Rust (SYNOPSIS) rustc [OPTIONS] INPUT (DESCRIPTION) Rust https://www.rust-lang.org . (OPTIONS) -h, --help . --cfg SPEC . -L [KIND=]PATH . KIND : dependency (transitive) crate `extern crate` native (native) framework OSX all () -l [KIND=]NAME crate() NAME. KIND static dylib framework . dylib . --crate-type [bin|lib|rlib|dylib|cdylib|staticlib|proc-macro] crate . --crate-name NAME crate . --emit [asm|llvm-bc|llvm-ir|obj|metadata|link|dep-info|mir][=PATH] rustc . PATH . -o . --print [crate-name|file-names|sysroot|target-libdir|cfg|target-list| target-cpus|target-features|relocation-models|code-models|tls-models| target-spec-json|native-static-libs|stack-protector-strategies| link-args] stdout. -g -C debuginfo=2. -O -C opt-level=2. -o FILENAME FILENAME. --emit . --out-dir DIR DIR . -o . . --explain OPT . --test (test harness). --target TARGET (target tuple) . . --- : x86 arm thumb mips . ARM : v5 v6m v7a v7m . pc apple nvidia ibm . none linux win32 darwin cuda . eabi gnu android macho elf . -W help 'lint' . -W OPT, --warn OPT lint. -A OPT, --allow OPT lint. -D OPT, --deny OPT lint ( ). -F OPT, --forbid OPT lint ( ). -C FLAG[=VAL], --codegen FLAG[=VAL] (codegen) . -C help . CODEGEN OPTIONS . -V, --version . -v, --verbose (verbose). --remap-path-prefix from=to . from=to from '=' to . (object). . --remap-path-prefix foo=bar foo/lib.rs ./foo/lib.rs . --extern NAME=PATH Rust. extern crate . --sysroot PATH (system root). -Z FLAG (unstable) (perma-unstable). -Z help . --color auto|always|never : auto tty () always never . linker=/path/to/cc (linker) (objects). link-args='-flag1 -flag2' . lto (LTO) LLVM. target-cpu=help . 'help' . target-feature='+feature1,-feature2' . '+' '-' . llc -mcpu=help . passes=val (passes) LLVM . 'list' rustc . . llvm-args='-arg1 -arg2' LLVM. save-temps (.bc .o .no-opt.bc) . rpath rpath . no-prepopulate-passes LLVM . no-vectorize-loops LLVM . no-vectorize-slp SLP LLVM . soft-float . prefer-dynamic . no-integrated-as LLVM . no-redzone (redzone) . relocation-model=[pic,static,dynamic-no-pic] (relocation) . (: pic) code-model=[small,kernel,medium,large] . metadata=val (symbol name mangling). extra-filename=val . codegen-units=n (crate) n . remark=val ( "all"). no-stack-check ( !). debuginfo=val : 0 1 ( ) 2 . opt-level=VAL 0-3 s ( ) z ( ).SH " (ENVIRONMENT)" ( rustc --test) Rust . RUST_TEST_THREADS Rust . . --test-threads . RUST_TEST_NOCAPTURE "0" --nocapture . RUST_MIN_STACK (stack) . RUST_BACKTRACE "0" panic backtrace . (EXAMPLES) main: $ rustc -o hello hello.rs : $ rustc --crate-type=lib hello-lib.rs crate (.rs): $ rustc hello.rs : $ rustc -g -o hello hello.rs (SEE ALSO) rustdoc(1) (BUGS) https://github.com/rust-lang/rust/issues . (AUTHORS) https://github.com/rust-lang/rust/graphs/contributors `git log --all --format='%cN <%cE>' | sort -u` rust . (COPYRIGHT) Apache 2.0 MIT . COPYRIGHT rust . rustc 1.98.1 (48a229cea 2026-09-01) April 2019 RUSTC(1)