Skip to content

Commit 1b04b92

Browse files
committed
---
yaml --- r: 7923 b: refs/heads/snap-stage3 c: 8abcafe h: refs/heads/master i: 7921: 3707459 7919: 64cea62 v: v3
1 parent 26ac82b commit 1b04b92

File tree

3 files changed

+128
-122
lines changed

3 files changed

+128
-122
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 2898dcc5d97da9427ac367542382b6239d9c0bbf
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 9db1d16f610cae5611dc07a0b65daef69f435274
4+
refs/heads/snap-stage3: 8abcafe7ad1f3bdf48a0ba73a2d18d80fdeabfde
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/snap-stage3/man/rustc.1

Lines changed: 83 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,137 +1,134 @@
1-
.TH RUSTC "1" "October 2011" "Rust" "User Commands"
1+
.TH RUSTC "1" "January 2012" "Rust" "User Commands"
2+
23
.SH NAME
34
rustc \- rust compiler
5+
46
.SH SYNOPSIS
57
rustc [\fB-h\fR] [\fB-v\fR] [\fB-o\fR \fIoutfile\fR]
68
[\fB--lib\fR] [\fB--static\fR] [\fB-L\fR \fIpath\fR]
79
[\fB-g\fR] [\fB-S\fR] [\fB-c\fR] <\fIinput\fR>
810
.PP
911
Only the most commonly-used options are listed here. All options are listed and
1012
described below.
13+
1114
.SH DESCRIPTION
1215
This program is a compiler for the Rust language, available at
1316
<\fBhttps://www.rust-lang.org\fR>.
17+
1418
.SH OPTIONS
1519
.TP
16-
\fB-h, --help\fR:
17-
Display help.
20+
\fB--bin\fR
21+
Compile an executable crate (default)
1822
.TP
19-
\fB-v, --version\fR:
20-
Display version information.
23+
\fB-c\fR
24+
Compile and assemble, but do not link
2125
.TP
22-
\fB-o\fR \fIfilename\fR:
23-
Write output to \fIfilename\fR. The default
24-
output filename for \fBfoo.rs\fR is otherwise \fBfoo\fR plus any
25-
platform-specific extension (when compiling a binary), a
26-
platform-specific name, e.g. \fBlibfoo.so\fR (when compiling a
27-
library), \fBfoo.o\fR (when using \fB-c\fR), \fBfoo.s\fR (when using
28-
\fB-S\fR) or \fBfoo.bc\fR (when using \fB--emit-llvm\fR), and \fBfoo.ll\fR
29-
(when using both \fB-S\fR and \fB--emit-llvm\fR).
26+
\fB--cfg <cfgspec>\fR
27+
Configure the compilation environment
3028
.TP
31-
\fB--lib\fR:
32-
Compile and link a library crate into a shared object.
29+
\fB--emit-llvm\fR
30+
Produce an LLVM bitcode file
3331
.TP
34-
\fB--static\fR:
35-
Produce a statically-linked binary, or generate a static
36-
library.
32+
\fB-g\fR
33+
Produce debug info
3734
.TP
38-
\fB--pretty\fR \fI[type]\fR:
39-
Pretty-print the input. Valid \fItype\fRs are:
40-
.RS
35+
\fB--gc\fR
36+
Garbage collect shared data (experimental/temporary)
4137
.TP
42-
\fBnormal\fR: Un-annotated source (default).
38+
\fB-h --help\fR
39+
Display this message
4340
.TP
44-
\fBexpanded\fR: Crates expanded.
41+
\fB-L <path>\fR
42+
Add a directory to the library search path
4543
.TP
46-
\fBtyped\fR: Crates expanded, all expressions annotated with types.
44+
\fB--lib\fR
45+
Compile a library crate
4746
.TP
48-
\fBidentified\fR: Fully parenthesized, ast nodes and blocks annotated with IDs.
49-
.RE
47+
\fB--ls\fR
48+
List the symbols defined by a compiled librar crate
5049
.TP
51-
\fB--ls\fR:
52-
Lists symbols defined by the specified \fBcompiled\fR library.
50+
\fB--no-asm-comments\fR
51+
Do not add comments into the assembly source
5352
.TP
54-
\fB-L\fR \fIpath\fR:
55-
Adds \fIpath\fR to the library search path.
53+
\fB--no-lint-ctypes\fR
54+
Suppress warnings for possibly incorrect ctype usage
5655
.TP
57-
\fB--noverify\fR:
58-
Disables LLVM verification pass, which does sanity checking of
59-
bitcode generated by rustc. Using this option gives a slight speedup, at the
60-
cost of vastly reduced ability to catch rustc bugs. See
61-
<\fBhttp://llvm.org/docs/Passes.html\fR> for a list of properties checked.
56+
\fB--no-trans\fR
57+
Run all passes except translation; no output
6258
.TP
63-
\fB--parse-only\fR:
64-
Run the parse phase only. If parsing succeeds, produces no
65-
output.
59+
\fB--no-verify\fR
60+
Suppress LLVM verification step (slight speedup)
61+
(see http://llvm.org/docs/Passes.html for detail)
6662
.TP
67-
\fB--no-trans\fR:
68-
Run all passes except translation. Produces no output.
63+
\fB-O\fR
64+
Equivalent to --opt-level=2
6965
.TP
70-
\fB-g\fR:
71-
Produce debug info.
66+
\fB-o <filename>\fR
67+
Write output to <filename>
7268
.TP
73-
\fB--opt-level\fR \fIlevel\fR:
74-
Set optimization level to \fIlevel\fR.
69+
\fB--opt-level <lvl>\fR
70+
Optimize with possible levels 0-3
7571
.TP
76-
\fB-O\fR:
77-
Equal to --opt-level=2
72+
\fB--out-dir <dir>\fR
73+
Write output to compiler-chosen filename in <dir>
7874
.TP
79-
\fB-S\fR:
80-
Compile to assembly, but do not assemble or link.
75+
\fB--parse-only\fR
76+
Parse only; do not compile, assemble, or link
8177
.TP
82-
\fB-c\fR:
83-
Compile and assemble, but do not link.
78+
\fB--pretty [type]\fR
79+
Pretty-print the input instead of compiling; valid types are: \fBnormal\fR (un-annotated source), \fBexpanded\fR (crates expanded), \fBtyped\fR (crates expanded, with type annotations), or \fBidentified\fR (fully parenthesized, AST nodes and blocks with IDs)
8480
.TP
85-
\fB--emit-llvm\fR:
86-
Generate output files in LLVM format. When used with \fB-S\fR this generate LLVM
87-
intermediate language assembly files, otherwise this generates LLVM bitcode
88-
format object files.
81+
\fB-S\fR
82+
Compile only; do not assemble or link
8983
.TP
90-
\fB--save-temps\fR:
91-
For foo.rs, save generated bitcode before optimization to
92-
\fBfoo.bc\fR, bitcode after optimization to \fBfoo.opt.bc\fR, and the generated
93-
object file to \fBfoo.o\fR.
84+
\fB--save-temps\fR
85+
Write intermediate files (.bc, .opt.bc, .o) in addition to normal output
9486
.TP
95-
\fB--stats\fR:
96-
Print statistics about compilation.
87+
\fB--static\fR
88+
Use or produce static libraries or binaries
9789
.TP
98-
\fB--cfg\fR \fIcfgspec\fR:
99-
Provide a crate config spec.
90+
\fB--stats\fR
91+
Print compilation statistics
10092
.TP
101-
\fB--time-passes\fR:
102-
Print runtimes of compilation phases.
93+
\fB--sysroot <path>\fR
94+
Override the system root
10395
.TP
104-
\fB--time-llvm-passes\fR:
105-
Print runtimes of llvm phases.
96+
\fB--test\fR
97+
Build test harness
10698
.TP
107-
\fB--sysroot\fR \fIpath\fR:
108-
Set the system root. Default is the directory above
109-
rustc's.
99+
\fB--target <triple>\fR
100+
Target cpu-manufacturer-kernel[-os] to compile for (default: host triple)
101+
(see http://sources.redhat.com/autobook/autobook/autobook_17.html for detail)
110102
.TP
111-
\fB--target\fR \fIgnu-config-name\fR:
112-
Set the compilation target, which is a
113-
string of the form \fBcpu\fR-\fBmanufacturer\fR-\fBkernel\fR[-\fBos\fR]. Example
114-
values include "i686-unknown-linux-gnu" and "mips-idt-ecoff"; see
115-
<\fBhttp://sources.redhat.com/autobook/autobook/autobook_17.html\fR>. If not
116-
supplied, the host triple is used (see \fB--version\fR output).
103+
\fB--time-passes\fR
104+
Time the individual phases of the compiler
117105
.TP
118-
\fB--test\fR:
119-
Build a test harness.
106+
\fB--time-llvm-passes\fR
107+
Time the individual phases of the LLVM backend
120108
.TP
121-
\fB--gc\fR:
122-
\fBEXPERIMENTAL\fR. Garbage-collect shared data.
109+
\fB-v --version\fR
110+
Print version info and exit
123111
.TP
124-
\fB--warn-unused-imports\fR:
125-
Warn about unnecessary imports.
126-
.TP
127-
\fB--no-lint-ctypes\fR:
128-
Disables checking of possibly incorrect usage of Rust int or uint types in
129-
native function declarations, where types defined in libcore::ctypes should be
130-
used instead. Ctypes check emits warnings by default.
112+
\fB--warn-unused-imports\fR
113+
Warn about unnecessary imports
114+
115+
.SH "EXAMPLES"
116+
To build an executable from a source file with a main function:
117+
$ rustc -o hello hello.rs
118+
119+
To build a library from a source file:
120+
$ rustc --lib hello-lib.rs
121+
122+
To build either with a crate (.rc) file:
123+
$ rustc hello.rc
124+
131125
.SH "BUGS"
132126
See \fBhttps://github.com/mozilla/rust/issues\fR for a list of known bugs.
127+
133128
.SH "AUTHOR"
134129
See \fBAUTHORS.txt\fR in the rust source distribution. Graydon Hoare
135130
<\fI[email protected]\fR> is the project leader.
131+
136132
.SH "COPYRIGHT"
137133
See \fBLICENSE.txt\fR in the rust source distribution.
134+

branches/snap-stage3/src/comp/driver/rustc.rs

Lines changed: 44 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -21,43 +21,52 @@ fn version(argv0: str) {
2121
}
2222

2323
fn usage(argv0: str) {
24-
io::stdout().write_str(#fmt["usage: %s [options] <input>\n", argv0] +
24+
io::stdout().write_str(#fmt["Usage: %s [options] <input>\n", argv0] +
2525
"
26-
options:
27-
28-
-h --help display this message
29-
-v --version print version info and exit
30-
31-
-o <filename> write output to <filename>
32-
--out-dir <dir> write output to compiler-chosen filename in <dir>
33-
--lib compile a library crate
34-
--bin compile an executable crate (default)
35-
--static use or produce static libraries
36-
--pretty [type] pretty-print the input instead of compiling
37-
--ls list the symbols defined by a crate file
38-
-L <path> add a directory to the library search path
39-
--no-verify suppress LLVM verification step (slight speedup)
40-
--parse-only parse only; do not compile, assemble, or link
41-
--no-trans run all passes except translation; no output
42-
-g produce debug info
43-
--opt-level <lvl> optimize with possible levels 0-3
44-
-O equivalent to --opt-level=2
45-
-S compile only; do not assemble or link
46-
--no-asm-comments do not add comments into the assembly source
47-
-c compile and assemble, but do not link
48-
--emit-llvm produce an LLVM bitcode file
49-
--save-temps write intermediate files in addition to normal output
50-
--stats gather and report various compilation statistics
51-
--cfg <cfgspec> configure the compilation environment
52-
--time-passes time the individual phases of the compiler
53-
--time-llvm-passes time the individual phases of the LLVM backend
54-
--sysroot <path> override the system root
55-
--target <triple> target to compile for (default: host triple)
56-
--test build test harness
57-
--gc garbage collect shared data (experimental/temporary)
26+
Options:
27+
28+
--bin Compile an executable crate (default)
29+
-c Compile and assemble, but do not link
30+
--cfg <cfgspec> Configure the compilation environment
31+
--emit-llvm Produce an LLVM bitcode file
32+
-g Produce debug info
33+
--gc Garbage collect shared data (experimental/temporary)
34+
-h --help Display this message
35+
-L <path> Add a directory to the library search path
36+
--lib Compile a library crate
37+
--ls List the symbols defined by a compiled library crate
38+
--no-asm-comments Do not add comments into the assembly source
39+
--no-lint-ctypes Suppress warnings for possibly incorrect ctype usage
40+
--no-trans Run all passes except translation; no output
41+
--no-verify Suppress LLVM verification step (slight speedup)
42+
(see http://llvm.org/docs/Passes.html for detail)
43+
-O Equivalent to --opt-level=2
44+
-o <filename> Write output to <filename>
45+
--opt-level <lvl> Optimize with possible levels 0-3
46+
--out-dir <dir> Write output to compiler-chosen filename in <dir>
47+
--parse-only Parse only; do not compile, assemble, or link
48+
--pretty [type] Pretty-print the input instead of compiling;
49+
valid types are: normal (un-annotated source),
50+
expanded (crates expanded), typed (crates expanded,
51+
with type annotations), or identified (fully
52+
parenthesized, AST nodes and blocks with IDs)
53+
-S Compile only; do not assemble or link
54+
--save-temps Write intermediate files (.bc, .opt.bc, .o)
55+
in addition to normal output
56+
--static Use or produce static libraries or binaries
57+
--stats Print compilation statistics
58+
--sysroot <path> Override the system root
59+
--test Build a test harness
60+
--target <triple> Target cpu-manufacturer-kernel[-os] to compile for
61+
(default: host triple)
62+
(see http://sources.redhat.com/autobook/autobook/
63+
autobook_17.html for detail)
64+
65+
--time-passes Time the individual phases of the compiler
66+
--time-llvm-passes Time the individual phases of the LLVM backend
67+
-v --version Print version info and exit
5868
--warn-unused-imports
59-
warn about unnecessary imports
60-
--no-lint-ctypes suppress lint-style ctypes usage check
69+
Warn about unnecessary imports
6170
6271
");
6372
}

0 commit comments

Comments
 (0)