.TH RUSTC "1" "July 2013" "rustc 0.7" "User Commands" .SH NAME rustc \- rust compiler .SH SYNOPSIS .B rustc [\fIOPTIONS\fR] \fIINPUT\fR .SH DESCRIPTION This program is a compiler for the Rust language, available at <\fBhttps://www.rust-lang.org\fR>. .SH OPTIONS .TP \fB\-\-crate-type=[bin|lib|dylib|rlib|staticlib]\fR Configure the flavor of rust crate that is generated (default `bin`) .TP \fB\-\-cfg\fR SPEC Configure the compilation environment .TP \fB\-\-emit=[asm,ir,bc,obj,link]\fR Configure the output that rustc will produce .TP \fB\-h\fR, \fB\-\-help\fR Display this message .TP \fB\-L\fR PATH Add a directory to the library search path .TP \fB\-\-linker\fR LINKER Program to use for linking instead of the default .TP \fB\-\-link-args\fR FLAGS A space-separated list of flags passed to the linker .TP \fB\-\-ls\fR List the symbols defined by a library crate .TP \fB\-\-no\-trans\fR Run all passes except translation; no output .TP \fB\-O\fR Equivalent to \fI\-\-opt\-level=2\fR .TP \fB\-o\fR FILENAME Write output to . Ignored if more than one --emit is specified. .TP \fB\-\-opt\-level\fR LEVEL Optimize with possible levels 0-3 .TP \fB\-\-passes\fR NAMES Comma- or space-separated list of optimization passes. Overrides the default passes for the optimization level. A value of 'list' will list the available passes. .TP \fB\-\-out\-dir\fR DIR Write output to compiler-chosen filename in . Ignored if -o is specified. (default the current directory) .TP \fB\-\-parse\-only\fR Parse only; do not compile, assemble, or link .TP \fB\-\-pretty\fR [TYPE] Pretty-print the input instead of compiling; valid types are: normal (un-annotated source), expanded (crates expanded), typed (crates expanded, with type annotations), or identified (fully parenthesized, AST nodes and blocks with IDs) .TP \fB\-\-save\-temps\fR Write intermediate files (.bc, .opt.bc, .o) in addition to normal output .TP \fB\-\-sysroot\fR PATH Override the system root .TP \fB\-\-test\fR Build a test harness .TP \fB\-\-target\fR TRIPLE Target triple cpu-manufacturer-kernel[-os] to compile for (see http://sources.redhat.com/autobook/autobook/autobook_17.html for details) .TP \fB\-\-target-feature\fR TRIPLE Target-specific attributes (see llc -mattr=help for details) .TP \fB\-\-android-cross-path\fR PATH The path to the Android NDK .TP \fB\-W\fR help Print 'lint' options and default settings .TP \fB\-W\fR OPT, \fB\-\-warn\fR OPT Set lint warnings .TP \fB\-A\fR OPT, \fB\-\-allow\fR OPT Set lint allowed .TP \fB\-D\fR OPT, \fB\-\-deny\fR OPT Set lint denied .TP \fB\-F\fR OPT, \fB\-\-forbid\fR OPT Set lint forbidden .TP \fB\-Z\fR FLAG Set internal debugging options. Use "-Z help" to print available options. .TP \fB\-v\fR, \fB\-\-version\fR Print version info and exit .SH "EXAMPLES" To build an executable from a source file with a main function: $ rustc -o hello hello.rs To build a library from a source file: $ rustc --crate-type=lib hello-lib.rs To build either with a crate (.rs) file: $ rustc hello.rs To build an executable with debug info (experimental): $ rustc -Z debug-info -o hello hello.rs .SH "SEE ALSO" rustdoc .SH "BUGS" See <\fBhttps://github.com/mozilla/rust/issues\fR> for issues. .SH "AUTHOR" See \fBAUTHORS.txt\fR in the rust source distribution. Graydon Hoare <\fIgraydon@mozilla.com\fR> is the project leader. .SH "COPYRIGHT" This work is dual-licensed under Apache 2.0 and MIT terms. See \fBCOPYRIGHT\fR file in the rust source distribution.