]> git.lizzy.rs Git - rust.git/blob - man/rustc.1
Emit lifetime end markers for function arguments
[rust.git] / man / rustc.1
1 .TH RUSTC "1" "March 2014" "rustc 0.13.0" "User Commands"
2 .SH NAME
3 rustc \- The Rust compiler
4 .SH SYNOPSIS
5 .B rustc
6 [\fIOPTIONS\fR] \fIINPUT\fR
7
8 .SH DESCRIPTION
9 This program is a compiler for the Rust language, available at
10 <\fBhttps://www.rust-lang.org\fR>.
11
12 .SH OPTIONS
13
14 .TP
15 \fB\-\-crate-name NAME\fR
16 Specify the name of the crate being built
17 .TP
18 \fB\-\-crate-type=[bin|lib|dylib|rlib|staticlib]\fR
19 Configure the flavor of rust crate that is generated (default `bin`)
20 .TP
21 \fB\-\-cfg\fR SPEC
22 Configure the compilation environment
23 .TP
24 \fB\-\-emit=[asm,ir,bc,obj,link]\fR
25 Configure the output that rustc will produce
26 .TP
27 \fB\-h\fR, \fB\-\-help\fR
28 Display this message
29 .TP
30 \fB\-L\fR PATH
31 Add a directory to the library search path
32 .TP
33 \fB\-\-no\-trans\fR
34 Run all passes except translation; no output
35 .TP
36 \fB\-\-no\-analysis\fR
37 Parse and expand the source, but run no analysis and produce no output
38 .TP
39 \fB\-g\fR
40 Emit DWARF debug information into object files generated.
41 .TP
42 \fB\-\-debuginfo\fR LEVEL
43 Emit DWARF debug info to the objects created: 0 = no debug info, 1 =
44 line-tables only (for stacktraces and breakpoints), 2 = full debug
45 info with variable and type information (same as -g).
46 .TP
47 \fB\-O\fR
48 Equivalent to \fI\-\-opt\-level=2\fR
49 .TP
50 \fB\-o\fR FILENAME
51 Write output to <filename>. Ignored if more than one --emit is specified.
52 .TP
53 \fB\-\-opt\-level\fR LEVEL
54 Optimize with possible levels 0-3
55 .TP
56 \fB\-\-out\-dir\fR DIR
57 Write output to compiler-chosen filename in <dir>. Ignored if -o is specified.
58 (default the current directory)
59 .TP
60 \fB\-\-parse\-only\fR
61 Parse only; do not compile, assemble, or link
62 .TP
63 \fB\-\-pretty\fR [TYPE]
64 Pretty-print the input instead of compiling; valid types are: normal
65 (un-annotated source), expanded (crates expanded), typed (crates
66 expanded, with type annotations), identified (fully parenthesized,
67 AST nodes and blocks with IDs), or flowgraph=<nodeid> (graphviz
68 formatted flowgraph for node)
69 .TP
70 \fB\-\-dep-info\fR [FILENAME]
71 Output dependency info to <filename> after compiling, in a format suitable
72 for use by Makefiles.
73 .TP
74 \fB\-\-sysroot\fR PATH
75 Override the system root
76 .TP
77 \fB\-\-test\fR
78 Build a test harness
79 .TP
80 \fB\-\-target\fR TRIPLE
81 Target triple cpu-manufacturer-kernel[-os] to compile for (see
82 http://sources.redhat.com/autobook/autobook/autobook_17.html
83 for details)
84 .TP
85 \fB\-W\fR help
86 Print 'lint' options and default settings
87 .TP
88 \fB\-W\fR OPT, \fB\-\-warn\fR OPT
89 Set lint warnings
90 .TP
91 \fB\-A\fR OPT, \fB\-\-allow\fR OPT
92 Set lint allowed
93 .TP
94 \fB\-D\fR OPT, \fB\-\-deny\fR OPT
95 Set lint denied
96 .TP
97 \fB\-F\fR OPT, \fB\-\-forbid\fR OPT
98 Set lint forbidden
99 .TP
100 \fB\-Z\fR FLAG
101 Set internal debugging options. Use "-Z help" to print available options.
102 .TP
103 \fB\-C\fR FLAG[=VAL], \fB\-\-codegen\fR FLAG[=VAL]
104 Set a codegen-related flag to the value specified. Use "-C help" to print
105 available flags. See CODEGEN OPTIONS below
106 .TP
107 \fB\-v\fR, \fB\-\-version\fR
108 Print version info and exit
109
110 .SH CODEGEN OPTIONS
111
112 .TP
113 \fBar\fR=/path/to/ar
114 Path to the archive utility to use when assembling archives.
115 .TP
116 \fBlinker\fR=/path/to/cc
117 Path to the linker utility to use when linking libraries, executables, and
118 objects.
119 .TP
120 \fBlink-args\fR='-flag1 -flag2'
121 A space-separated list of extra arguments to pass to the linker when the linker
122 is invoked.
123 .TP
124 \fBtarget-cpu\fR=help
125 Selects a target processor. If the value is 'help', then a list of available
126 CPUs is printed.
127 .TP
128 \fBtarget-feature\fR='+feature1,-feature2'
129 A comma-separated list of features to enable or disable for the target. A
130 preceding '+' enables a feature while a preceding '-' disables it. Available
131 features can be discovered through target-cpu=help.
132 .TP
133 \fBpasses\fR=list
134 A space-separated list of extra LLVM passes to run. A value of 'list' will
135 cause rustc to print all known passes and exit. The passes specified are
136 appended at the end of the normal pass manager.
137 .TP
138 \fBllvm-args\fR='-arg1 -arg2'
139 A space-separated list of arguments to pass through to LLVM.
140 .TP
141 \fBsave-temps\fR
142 If specified, the compiler will save more files (.bc, .o, .no-opt.bc) generated
143 throughout compilation in the output directory.
144 .TP
145 \fBrpath\fR
146 If specified, then the rpath value for dynamic libraries will be set in
147 either dynamic library or executable outputs.
148 .TP
149 \fBno-prepopulate-passes\fR
150 Suppresses pre-population of the LLVM pass manager that is run over the module.
151 .TP
152 \fBno-vectorize-loops\fR
153 Suppresses running the loop vectorization LLVM pass, regardless of optimization
154 level.
155 .TP
156 \fBno-vectorize-slp\fR
157 Suppresses running the LLVM SLP vectorization pass, regardless of optimization
158 level.
159 .TP
160 \fBsoft-float\fR
161 Generates software floating point library calls instead of hardware
162 instructions.
163 .TP
164 \fBprefer-dynamic\fR
165 Prefers dynamic linking to static linking.
166 .TP
167 \fBno-integrated-as\fR
168 Force usage of an external assembler rather than LLVM's integrated one.
169 .TP
170 \fBrelocation-model\fR=[pic,static,dynamic-no-pic]
171 The relocation model to use. (default: pic)
172
173 .SH "EXAMPLES"
174 To build an executable from a source file with a main function:
175     $ rustc -o hello hello.rs
176
177 To build a library from a source file:
178     $ rustc --crate-type=lib hello-lib.rs
179
180 To build either with a crate (.rs) file:
181     $ rustc hello.rs
182
183 To build an executable with debug info:
184     $ rustc -g -o hello hello.rs
185
186 .SH "SEE ALSO"
187
188 rustdoc
189
190 .SH "BUGS"
191 See <\fBhttps://github.com/rust-lang/rust/issues\fR> for issues.
192
193 .SH "AUTHOR"
194 See \fBAUTHORS.txt\fR in the Rust source distribution.
195
196 .SH "COPYRIGHT"
197 This work is dual-licensed under Apache 2.0 and MIT terms.  See \fBCOPYRIGHT\fR
198 file in the rust source distribution.