Skip to content

Commit 8836955

Browse files
committed
---
yaml --- r: 7924 b: refs/heads/snap-stage3 c: d3aa174 h: refs/heads/master v: v3
1 parent 1b04b92 commit 8836955

File tree

5 files changed

+172
-133
lines changed

5 files changed

+172
-133
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: 8abcafe7ad1f3bdf48a0ba73a2d18d80fdeabfde
4+
refs/heads/snap-stage3: d3aa1748461e1220fb26a6e556a78b88a32cc2bd
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/snap-stage3/man/rustc.1

Lines changed: 86 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,134 +1,137 @@
1-
.TH RUSTC "1" "January 2012" "Rust" "User Commands"
2-
1+
.TH RUSTC "1" "October 2011" "Rust" "User Commands"
32
.SH NAME
43
rustc \- rust compiler
5-
64
.SH SYNOPSIS
75
rustc [\fB-h\fR] [\fB-v\fR] [\fB-o\fR \fIoutfile\fR]
86
[\fB--lib\fR] [\fB--static\fR] [\fB-L\fR \fIpath\fR]
97
[\fB-g\fR] [\fB-S\fR] [\fB-c\fR] <\fIinput\fR>
108
.PP
119
Only the most commonly-used options are listed here. All options are listed and
1210
described below.
13-
1411
.SH DESCRIPTION
1512
This program is a compiler for the Rust language, available at
1613
<\fBhttps://www.rust-lang.org\fR>.
17-
1814
.SH OPTIONS
1915
.TP
20-
\fB--bin\fR
21-
Compile an executable crate (default)
16+
\fB-h, --help\fR:
17+
Display help.
2218
.TP
23-
\fB-c\fR
24-
Compile and assemble, but do not link
19+
\fB-v, --version\fR:
20+
Display version information.
2521
.TP
26-
\fB--cfg <cfgspec>\fR
27-
Configure the compilation environment
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).
2830
.TP
29-
\fB--emit-llvm\fR
30-
Produce an LLVM bitcode file
31+
\fB--lib\fR:
32+
Compile and link a library crate into a shared object.
3133
.TP
32-
\fB-g\fR
33-
Produce debug info
34+
\fB--static\fR:
35+
Produce a statically-linked binary, or generate a static
36+
library.
3437
.TP
35-
\fB--gc\fR
36-
Garbage collect shared data (experimental/temporary)
38+
\fB--pretty\fR \fI[type]\fR:
39+
Pretty-print the input. Valid \fItype\fRs are:
40+
.RS
3741
.TP
38-
\fB-h --help\fR
39-
Display this message
42+
\fBnormal\fR: Un-annotated source (default).
4043
.TP
41-
\fB-L <path>\fR
42-
Add a directory to the library search path
44+
\fBexpanded\fR: Crates expanded.
4345
.TP
44-
\fB--lib\fR
45-
Compile a library crate
46+
\fBtyped\fR: Crates expanded, all expressions annotated with types.
4647
.TP
47-
\fB--ls\fR
48-
List the symbols defined by a compiled librar crate
48+
\fBidentified\fR: Fully parenthesized, ast nodes and blocks annotated with IDs.
49+
.RE
4950
.TP
50-
\fB--no-asm-comments\fR
51-
Do not add comments into the assembly source
51+
\fB--ls\fR:
52+
Lists symbols defined by the specified \fBcompiled\fR library.
5253
.TP
53-
\fB--no-lint-ctypes\fR
54-
Suppress warnings for possibly incorrect ctype usage
54+
\fB-L\fR \fIpath\fR:
55+
Adds \fIpath\fR to the library search path.
5556
.TP
56-
\fB--no-trans\fR
57-
Run all passes except translation; no output
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.
5862
.TP
59-
\fB--no-verify\fR
60-
Suppress LLVM verification step (slight speedup)
61-
(see http://llvm.org/docs/Passes.html for detail)
63+
\fB--parse-only\fR:
64+
Run the parse phase only. If parsing succeeds, produces no
65+
output.
6266
.TP
63-
\fB-O\fR
64-
Equivalent to --opt-level=2
67+
\fB--no-trans\fR:
68+
Run all passes except translation. Produces no output.
6569
.TP
66-
\fB-o <filename>\fR
67-
Write output to <filename>
70+
\fB-g\fR:
71+
Produce debug info.
6872
.TP
69-
\fB--opt-level <lvl>\fR
70-
Optimize with possible levels 0-3
73+
\fB--opt-level\fR \fIlevel\fR:
74+
Set optimization level to \fIlevel\fR.
7175
.TP
72-
\fB--out-dir <dir>\fR
73-
Write output to compiler-chosen filename in <dir>
76+
\fB-O\fR:
77+
Equal to --opt-level=2
7478
.TP
75-
\fB--parse-only\fR
76-
Parse only; do not compile, assemble, or link
79+
\fB-S\fR:
80+
Compile to assembly, but do not assemble or link.
7781
.TP
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)
82+
\fB-c\fR:
83+
Compile and assemble, but do not link.
8084
.TP
81-
\fB-S\fR
82-
Compile only; do not assemble or link
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.
8389
.TP
84-
\fB--save-temps\fR
85-
Write intermediate files (.bc, .opt.bc, .o) in addition to normal output
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.
8694
.TP
87-
\fB--static\fR
88-
Use or produce static libraries or binaries
95+
\fB--stats\fR:
96+
Print statistics about compilation.
8997
.TP
90-
\fB--stats\fR
91-
Print compilation statistics
98+
\fB--cfg\fR \fIcfgspec\fR:
99+
Provide a crate config spec.
92100
.TP
93-
\fB--sysroot <path>\fR
94-
Override the system root
101+
\fB--time-passes\fR:
102+
Print runtimes of compilation phases.
95103
.TP
96-
\fB--test\fR
97-
Build test harness
104+
\fB--time-llvm-passes\fR:
105+
Print runtimes of llvm phases.
98106
.TP
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)
107+
\fB--sysroot\fR \fIpath\fR:
108+
Set the system root. Default is the directory above
109+
rustc's.
102110
.TP
103-
\fB--time-passes\fR
104-
Time the individual phases of the compiler
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).
105117
.TP
106-
\fB--time-llvm-passes\fR
107-
Time the individual phases of the LLVM backend
118+
\fB--test\fR:
119+
Build a test harness.
108120
.TP
109-
\fB-v --version\fR
110-
Print version info and exit
121+
\fB--gc\fR:
122+
\fBEXPERIMENTAL\fR. Garbage-collect shared data.
111123
.TP
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-
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.
125131
.SH "BUGS"
126132
See \fBhttps://github.com/mozilla/rust/issues\fR for a list of known bugs.
127-
128133
.SH "AUTHOR"
129134
See \fBAUTHORS.txt\fR in the rust source distribution. Graydon Hoare
130135
<\fI[email protected]\fR> is the project leader.
131-
132136
.SH "COPYRIGHT"
133137
See \fBLICENSE.txt\fR in the rust source distribution.
134-

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

Lines changed: 35 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -21,52 +21,43 @@ 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-
--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
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)
6858
--warn-unused-imports
69-
Warn about unnecessary imports
59+
warn about unnecessary imports
60+
--no-lint-ctypes suppress lint-style ctypes usage check
7061
7162
");
7263
}

branches/snap-stage3/src/rustdoc/doc.rs

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ enum itemtag {
1111
consttag(constdoc),
1212
fntag(fndoc),
1313
enumtag(enumdoc),
14-
restag(resdoc)
14+
restag(resdoc),
15+
ifacetag(ifacedoc)
1516
}
1617

1718
type moddoc = {
@@ -77,6 +78,24 @@ type resdoc = {
7778
sig: option<str>
7879
};
7980

81+
type ifacedoc = {
82+
id: ast_id,
83+
name: str,
84+
brief: option<str>,
85+
desc: option<str>,
86+
methods: [methoddoc]
87+
};
88+
89+
type methoddoc = {
90+
name: str,
91+
brief: option<str>,
92+
desc: option<str>,
93+
args: [argdoc],
94+
return: retdoc,
95+
failure: option<str>,
96+
sig: option<str>
97+
};
98+
8099
impl util for moddoc {
81100

82101
fn mods() -> [moddoc] {
@@ -123,6 +142,15 @@ impl util for moddoc {
123142
}
124143
}
125144
}
145+
146+
fn ifaces() -> [ifacedoc] {
147+
vec::filter_map(*self.items) {|itemtag|
148+
alt itemtag {
149+
ifacetag(ifacedoc) { some(ifacedoc) }
150+
_ { none }
151+
}
152+
}
153+
}
126154
}
127155

128156
impl util for itemtag {
@@ -133,6 +161,7 @@ impl util for itemtag {
133161
doc::consttag({name, _}) { name }
134162
doc::enumtag({name, _}) { name }
135163
doc::restag({name, _}) { name }
164+
doc::ifacetag({name, _}) { name }
136165
}
137166
}
138167
}

0 commit comments

Comments
 (0)