1 .TH RUSTC "1" "July 2013" "rustc 0.7" "User Commands"
6 [\fIOPTIONS\fR] \fIINPUT\fR
9 This program is a compiler for the Rust language, available at
10 <\fBhttps://www.rust-lang.org\fR>.
16 Compile an executable crate (default)
19 Compile and assemble, but do not link
22 Configure the compilation environment
25 Produce an LLVM bitcode file
27 \fB\-h\fR, \fB\-\-help\fR
31 Add a directory to the library search path
34 Compile a library crate
36 \fB\-\-linker\fR LINKER
37 Program to use for linking instead of the default
39 \fB\-\-link-args\fR FLAGS
40 A space-separated list of flags passed to the linker
43 List the symbols defined by a library crate
46 Run all passes except translation; no output
49 Equivalent to \fI\-\-opt\-level=2\fR
52 Write output to <filename>
54 \fB\-\-opt\-level\fR LEVEL
55 Optimize with possible levels 0-3
57 \fB\-\-passes\fR NAMES
58 Comma- or space-separated list of optimization passes. Overrides
59 the default passes for the optimization level. A value of 'list'
60 will list the available passes.
62 \fB\-\-out\-dir\fR DIR
63 Write output to compiler-chosen filename in <dir>
66 Parse only; do not compile, assemble, or link
68 \fB\-\-pretty\fR [TYPE]
69 Pretty-print the input instead of compiling; valid types are: normal
70 (un-annotated source), expanded (crates expanded), typed (crates
71 expanded, with type annotations), or identified (fully parenthesized,
72 AST nodes and blocks with IDs)
75 Compile only; do not assemble or link
78 Write intermediate files (.bc, .opt.bc, .o) in addition to normal output
80 \fB\-\-sysroot\fR PATH
81 Override the system root
86 \fB\-\-target\fR TRIPLE
87 Target triple cpu-manufacturer-kernel[-os] to compile for (see
88 http://sources.redhat.com/autobook/autobook/autobook_17.html
91 \fB\-\-target-feature\fR TRIPLE
92 Target-specific attributes (see llc -mattr=help for details)
94 \fB\-\-android-cross-path\fR PATH
95 The path to the Android NDK
98 Print 'lint' options and default settings
100 \fB\-W\fR OPT, \fB\-\-warn\fR OPT
103 \fB\-A\fR OPT, \fB\-\-allow\fR OPT
106 \fB\-D\fR OPT, \fB\-\-deny\fR OPT
109 \fB\-F\fR OPT, \fB\-\-forbid\fR OPT
113 Set internal debugging options. Use "-Z help" to print available options.
115 \fB\-v\fR, \fB\-\-version\fR
116 Print version info and exit
119 To build an executable from a source file with a main function:
120 $ rustc -o hello hello.rs
122 To build a library from a source file:
123 $ rustc --lib hello-lib.rs
125 To build either with a crate (.rc) file:
128 To build an executable with debug info (experimental):
129 $ rustc -Z debug-info -o hello hello.rs
136 See <\fBhttps://github.com/mozilla/rust/issues\fR> for issues.
139 See \fBAUTHORS.txt\fR in the rust source distribution. Graydon Hoare
140 <\fIgraydon@mozilla.com\fR> is the project leader.
143 This work is dual-licensed under Apache 2.0 and MIT terms. See \fBCOPYRIGHT\fR
144 file in the rust source distribution.