1
- .TH RUSTC "1" "October 2012 " "rustc 0.4 " "User Commands"
1
+ .TH RUSTC "1" "February 2013 " "rustc 0.6 " "User Commands"
2
2
.SH NAME
3
3
rustc \- rust compiler
4
4
.SH SYNOPSIS
5
5
.B rustc
6
- [\fI options \fR ] \fI <input> \fR
6
+ [\fI OPTIONS \fR ] \fI INPUT \fR
7
7
8
8
.SH DESCRIPTION
9
9
This program is a compiler for the Rust language, available at
@@ -18,88 +18,134 @@ Compile an executable crate (default)
18
18
\fB \- c \fR
19
19
Compile and assemble, but do not link
20
20
.TP
21
- \fB \-\- cfg \fR <cfgspec>
21
+ \fB \-\- cfg \fR SPEC
22
22
Configure the compilation environment
23
23
.TP
24
24
\fB \-\- emit \- llvm \fR
25
25
Produce an LLVM bitcode file
26
26
.TP
27
- \fB \- g \fR
28
- Produce debug info (experimental)
29
- .TP
30
- \fB \-\- gc \fR
31
- Garbage collect shared data (experimental/temporary)
32
- .TP
33
- \fB \- h \fR \fB \-\- help \fR
27
+ \fB \- h \fR , \fB \-\- help \fR
34
28
Display this message
35
29
.TP
36
- \fB \- L \fR <path>
30
+ \fB \- L \fR PATH
37
31
Add a directory to the library search path
38
32
.TP
39
33
\fB \-\- lib \fR
40
34
Compile a library crate
41
35
.TP
42
36
\fB \-\- ls \fR
43
- List the symbols defined by a compiled library crate
44
- .TP
45
- \fB \-\- jit \fR
46
- Execute using JIT (experimental)
37
+ List the symbols defined by a library crate
47
38
.TP
48
39
\fB \-\- no \- trans \fR
49
40
Run all passes except translation; no output
50
41
.TP
51
42
\fB \- O \fR
52
- Equivalent to \fB \-\- opt \- level \fR = \fI 2 \fR
43
+ Equivalent to \fI \-\- opt \- level=2 \fR
53
44
.TP
54
- \fB \- o \fR <filename>
45
+ \fB \- o \fR FILENAME
55
46
Write output to <filename>
56
47
.TP
57
- \fB \-\- opt \- level \fR <lvl>
58
- Optimize with possible levels 0\ - 3
48
+ \fB \-\- opt \- level \fR LEVEL
49
+ Optimize with possible levels 0-3
59
50
.TP
60
- \fB \-\- out \- dir \fR <dir>
61
- Write output to compiler\ - chosen filename in <dir>
51
+ \fB \-\- out \- dir \fR DIR
52
+ Write output to compiler-chosen filename in <dir>
62
53
.TP
63
54
\fB \-\- parse \- only \fR
64
55
Parse only; do not compile, assemble, or link
65
56
.TP
66
- \fB \-\- pretty \fR [type]
67
- Pretty\- print the input instead of compiling;
68
- valid types are: normal (un\- annotated source),
69
- expanded (crates expanded), typed (crates expanded,
70
- with type annotations), or identified (fully
71
- parenthesized, AST nodes and blocks with IDs)
57
+ \fB \-\- pretty \fR [TYPE]
58
+ Pretty-print the input instead of compiling; valid types are: normal
59
+ (un-annotated source), expanded (crates expanded), typed (crates
60
+ expanded, with type annotations), or identified (fully parenthesized,
61
+ AST nodes and blocks with IDs)
72
62
.TP
73
63
\fB \- S \fR
74
64
Compile only; do not assemble or link
75
65
.TP
76
66
\fB \-\- save \- temps \fR
77
- Write intermediate files (.bc, .opt.bc, .o)
78
- in addition to normal output
67
+ Write intermediate files (.bc, .opt.bc, .o) in addition to normal output
79
68
.TP
80
- \fB \-\- static \fR
81
- Use or produce static libraries or binaries
82
- (experimental)
83
- .TP
84
- \fB \-\- sysroot \fR <path>
69
+ \fB \-\- sysroot \fR PATH
85
70
Override the system root
86
71
.TP
87
72
\fB \-\- test \fR
88
73
Build a test harness
89
74
.TP
90
- \fB \-\- target \fR <triple>
91
- Target cpu\- manufacturer\- kernel[\- os] to compile for
92
- (default: host triple)
93
- (see http://sources.redhat.com/autobook/autobook/
94
- autobook_17.html for detail)
75
+ \fB \-\- target \fR TRIPLE
76
+ Target triple cpu-manufacturer-kernel[-os] to compile for (see
77
+ http://sources.redhat.com/autobook/autobook/autobook_17.html
78
+ for detail)
95
79
.TP
96
- \fB \- W help \fR
80
+ \fB \- W \fR help
97
81
Print 'lint' options and default settings
98
82
.TP
99
- \fB \- Z help \fR
100
- Print internal options for debugging rustc
83
+ \fB \- W \fR OPT, \fB \-\- warn \fR OPT
84
+ Set lint warnings
85
+ .TP
86
+ \fB \- A \fR OPT, \fB \-\- allow \fR OPT
87
+ Set lint allowed
101
88
.TP
102
- \fB \- v \fR \fB \-\- version \fR
89
+ \fB \- D \fR OPT, \fB \-\- deny \fR OPT
90
+ Set lint denied
91
+ .TP
92
+ \fB \- F \fR OPT, \fB \-\- forbid \fR OPT
93
+ Set lint forbidden
94
+ .TP
95
+ \fB \- Z \fR FLAG
96
+ Set internal debugging options. Use "-Z help" to print available options.
97
+
98
+ Available debug flags are:
99
+ .RS
100
+ .IP \[bu ]
101
+ \fB verbose \fR - in general, enable more debug printouts
102
+ .IP \[bu ]
103
+ \fB time \- passes \fR - measure time of each rustc pass
104
+ .IP \[bu ]
105
+ \fB count \- llvm \- insns \fR - count where LLVM instrs originate
106
+ .IP \[bu ]
107
+ \fB time \- llvm \- passes \fR - measure time of each LLVM pass
108
+ .IP \[bu ]
109
+ \fB trans \- stats \fR - gather trans statistics
110
+ .IP \[bu ]
111
+ \fB no \- asm \- comments \fR - omit comments when using \fI \- S \fR
112
+ .IP \[bu ]
113
+ \fB no \- verify \fR - skip LLVM verification
114
+ .IP \[bu ]
115
+ \fB trace \fR - emit trace logs
116
+ .IP \[bu ]
117
+ \fB coherence \fR - perform coherence checking
118
+ .IP \[bu ]
119
+ \fB borrowck \- stats \fR - gather borrowck statistics
120
+ .IP \[bu ]
121
+ \fB borrowck \- note \- pure \fR - note where purity is req'd
122
+ .IP \[bu ]
123
+ \fB borrowck \- note \- loan \fR - note where loans are req'd
124
+ .IP \[bu ]
125
+ \fB no \- landing \- pads \fR - omit landing pads for unwinding
126
+ .IP \[bu ]
127
+ \fB debug \- llvm \fR - enable debug output from LLVM
128
+ .IP \[bu ]
129
+ \fB count \- type \- sizes \fR - count the sizes of aggregate types
130
+ .IP \[bu ]
131
+ \fB meta \- stats \fR - gather metadata statistics
132
+ .IP \[bu ]
133
+ \fB no \- opt \fR - do not optimize, even if \fI \- O \fR is passed
134
+ .IP \[bu ]
135
+ \fB no \- monomorphic \- collapse \fR - do not collapse template instantiations
136
+ .IP \[bu ]
137
+ \fB gc \fR - Garbage collect shared data (experimental)
138
+ .IP \[bu ]
139
+ \fB jit \fR - Execute using JIT (experimental)
140
+ .IP \[bu ]
141
+ \fB extra \- debug \- info \fR - Extra debugging info (experimental)
142
+ .IP \[bu ]
143
+ \fB debug \- info \fR - Produce debug info (experimental)
144
+ .IP \[bu ]
145
+ \fB static \fR - Use or produce static libraries or binaries (experimental)
146
+ .RE
147
+ .TP
148
+ \fB \- v \fR , \fB \-\- version \fR
103
149
Print version info and exit
104
150
105
151
.SH "EXAMPLES"
@@ -112,6 +158,10 @@ To build a library from a source file:
112
158
To build either with a crate (.rc) file:
113
159
$ rustc hello.rc
114
160
161
+ To build an executable with debug info (experimental):
162
+ $ rustc -Z debug-info -o hello hello.rs
163
+
164
+
115
165
.SH "BUGS"
116
166
See <\fB https://github.com/mozilla/rust/issues \fR > for issues.
117
167
0 commit comments