Skip to content

Commit dc951ab

Browse files
committed
---
yaml --- r: 16069 b: refs/heads/try c: 0fa7858 h: refs/heads/master i: 16067: 41a95d1 v: v3
1 parent aa0a222 commit dc951ab

File tree

97 files changed

+1542
-1296
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+1542
-1296
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 432c6cbde93ca525cc33fd17873a0557dffa07c5
5+
refs/heads/try: 0fa7858d1e8d4ebf6e881780ec9a37cf22f4c0b0
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/man/rustc.1

Lines changed: 58 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,116 +1,114 @@
1-
.TH RUSTC "1" "January 2012" "Rust" "User Commands"
2-
1+
.TH RUSTC "1" "May 2012" "rustc 0.2 (23fcab9)" "User Commands"
32
.SH NAME
43
rustc \- rust compiler
5-
64
.SH SYNOPSIS
7-
rustc [\fB-h\fR] [\fB-v\fR] [\fB-o\fR \fIoutfile\fR]
8-
[\fB--lib\fR] [\fB--static\fR] [\fB-L\fR \fIpath\fR]
9-
[\fB-g\fR] [\fB-S\fR] [\fB-c\fR] <\fIinput\fR>
10-
.PP
11-
Only the most commonly-used options are listed here. All options are listed and
12-
described below.
5+
.B rustc
6+
[\fIoptions\fR] \fI<input>\fR
137

148
.SH DESCRIPTION
159
This program is a compiler for the Rust language, available at
1610
<\fBhttps://www.rust-lang.org\fR>.
1711

1812
.SH OPTIONS
13+
1914
.TP
20-
\fB--bin\fR
15+
\fB\-\-bin\fR
2116
Compile an executable crate (default)
2217
.TP
23-
\fB-c\fR
18+
\fB\-c\fR
2419
Compile and assemble, but do not link
2520
.TP
26-
\fB--cfg <cfgspec>\fR
21+
\fB\-\-cfg\fR <cfgspec>
2722
Configure the compilation environment
2823
.TP
29-
\fB--emit-llvm\fR
24+
\fB\-\-emit\-llvm\fR
3025
Produce an LLVM bitcode file
3126
.TP
32-
\fB-g\fR
27+
\fB\-g\fR
3328
Produce debug info
3429
.TP
35-
\fB--gc\fR
30+
\fB\-\-gc\fR
3631
Garbage collect shared data (experimental/temporary)
3732
.TP
38-
\fB-h --help\fR
33+
\fB\-h\fR \fB\-\-help\fR
3934
Display this message
4035
.TP
41-
\fB-L <path>\fR
36+
\fB\-L\fR <path>
4237
Add a directory to the library search path
4338
.TP
44-
\fB--lib\fR
39+
\fB\-\-lib\fR
4540
Compile a library crate
4641
.TP
47-
\fB--ls\fR
48-
List the symbols defined by a compiled librar crate
42+
\fB\-\-ls\fR
43+
List the symbols defined by a compiled library crate
4944
.TP
50-
\fB--no-asm-comments\fR
51-
Do not add comments into the assembly source
52-
.TP
53-
\fB--no-lint-ctypes\fR
54-
Suppress warnings for possibly incorrect ctype usage
55-
.TP
56-
\fB--no-trans\fR
45+
\fB\-\-no\-trans\fR
5746
Run all passes except translation; no output
5847
.TP
59-
\fB--no-verify\fR
60-
Suppress LLVM verification step (slight speedup)
61-
(see http://llvm.org/docs/Passes.html for detail)
62-
.TP
63-
\fB-O\fR
64-
Equivalent to --opt-level=2
48+
\fB\-O\fR
49+
Equivalent to \fB\-\-opt\-level\fR=\fI2\fR
6550
.TP
66-
\fB-o <filename>\fR
51+
\fB\-o\fR <filename>
6752
Write output to <filename>
6853
.TP
69-
\fB--opt-level <lvl>\fR
70-
Optimize with possible levels 0-3
54+
\fB\-\-opt\-level\fR <lvl>
55+
Optimize with possible levels 0\-3
7156
.TP
72-
\fB--out-dir <dir>\fR
73-
Write output to compiler-chosen filename in <dir>
57+
\fB\-\-out\-dir\fR <dir>
58+
Write output to compiler\-chosen filename in <dir>
7459
.TP
75-
\fB--parse-only\fR
60+
\fB\-\-parse\-only\fR
7661
Parse only; do not compile, assemble, or link
7762
.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)
63+
\fB\-\-pretty\fR [type]
64+
Pretty\-print the input instead of compiling;
65+
valid types are: \fBnormal\fR (un\-annotated source),
66+
\fBexpanded\fR (crates expanded), \fBtyped\fR (crates expanded,
67+
with type annotations), or \fBidentified\fR (fully
68+
parenthesized, AST nodes and blocks with IDs)
8069
.TP
81-
\fB-S\fR
70+
\fB\-S\fR
8271
Compile only; do not assemble or link
8372
.TP
84-
\fB--save-temps\fR
85-
Write intermediate files (.bc, .opt.bc, .o) in addition to normal output
73+
\fB\-\-save\-temps\fR
74+
Write intermediate files (.bc, .opt.bc, .o)
75+
in addition to normal output
8676
.TP
87-
\fB--static\fR
77+
\fB\-\-static\fR
8878
Use or produce static libraries or binaries
8979
.TP
90-
\fB--stats\fR
80+
\fB\-\-stats\fR
9181
Print compilation statistics
9282
.TP
93-
\fB--sysroot <path>\fR
83+
\fB\-\-sysroot\fR <path>
9484
Override the system root
9585
.TP
96-
\fB--test\fR
97-
Build test harness
86+
\fB\-\-test\fR
87+
Build a test harness
9888
.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)
89+
\fB\-\-target\fR <triple>
90+
Target cpu\-manufacturer\-kernel[\-os] to compile for
91+
(default: host triple)
92+
(see http://sources.redhat.com/autobook/autobook/
93+
autobook_17.html for detail)
10294
.TP
103-
\fB--time-passes\fR
104-
Time the individual phases of the compiler
95+
\fB\-W\fR <foo>
96+
enable warning <foo>
10597
.TP
106-
\fB--time-llvm-passes\fR
107-
Time the individual phases of the LLVM backend
98+
\fB\-W\fR no\-<foo>
99+
disable warning <foo>
108100
.TP
109-
\fB-v --version\fR
110-
Print version info and exit
101+
\fB\-W\fR err\-<foo>
102+
enable warning <foo> as an error
103+
.TP
104+
\fB\-W\fR help
105+
Print available warnings and default settings
106+
.TP
107+
\fB\-Z\fR help
108+
list internal options for debugging rustc
111109
.TP
112-
\fB--warn-unused-imports\fR
113-
Warn about unnecessary imports
110+
\fB\-v\fR \fB\-\-version\fR
111+
Print version info and exit
114112

115113
.SH "EXAMPLES"
116114
To build an executable from a source file with a main function:
@@ -131,4 +129,3 @@ See \fBAUTHORS.txt\fR in the rust source distribution. Graydon Hoare
131129

132130
.SH "COPYRIGHT"
133131
See \fBLICENSE.txt\fR in the rust source distribution.
134-

branches/try/src/cargo/cargo.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ fn install_uuid(c: cargo, wd: str, uuid: str) {
603603
for_each_package(c, { |s, p|
604604
info(#fmt["%s ? %s", p.uuid, uuid]);
605605
if p.uuid == uuid {
606-
vec::grow(ps, 1u, (s.name, p));
606+
vec::grow(ps, 1u, (s, p));
607607
}
608608
});
609609
if vec::len(ps) == 1u {
@@ -616,16 +616,16 @@ fn install_uuid(c: cargo, wd: str, uuid: str) {
616616
}
617617
error("Found multiple packages:");
618618
for ps.each {|elt|
619-
let (sname,p) = elt;
620-
info(" " + sname + "/" + p.uuid + " (" + p.name + ")");
619+
let (s,p) = elt;
620+
info(" " + s.name + "/" + p.uuid + " (" + p.name + ")");
621621
}
622622
}
623623

624624
fn install_named(c: cargo, wd: str, name: str) {
625625
let mut ps = [];
626626
for_each_package(c, { |s, p|
627627
if p.name == name {
628-
vec::grow(ps, 1u, (s.name, p));
628+
vec::grow(ps, 1u, (s, p));
629629
}
630630
});
631631
if vec::len(ps) == 1u {
@@ -638,8 +638,8 @@ fn install_named(c: cargo, wd: str, name: str) {
638638
}
639639
error("Found multiple packages:");
640640
for ps.each {|elt|
641-
let (sname,p) = elt;
642-
info(" " + sname + "/" + p.uuid + " (" + p.name + ")");
641+
let (s,p) = elt;
642+
info(" " + s.name + "/" + p.uuid + " (" + p.name + ")");
643643
}
644644
}
645645

branches/try/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ fn check_expected_errors(expected_errors: [errors::expected_error],
277277
}
278278
}
279279

280-
for uint::range(0u, vec::len(found_flags)) {|i|
280+
uint::range(0u, vec::len(found_flags)) {|i|
281281
if !found_flags[i] {
282282
let ee = expected_errors[i];
283283
fatal_procres(#fmt["expected %s on line %u not found: %s",

branches/try/src/libcore/core.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ built-in types and runtime services, or that is used in nearly every
1313
non-trivial program.
1414

1515
`core` includes modules corresponding to each of the integer types, each of
16-
the floating point types, the `bool` type, tuples, characters, strings,
16+
THE floating point types, the `bool` type, tuples, characters, strings,
1717
vectors (`vec`), shared boxes (`box`), and unsafe pointers (`ptr`).
1818
Additionally, `core` provides very commonly used built-in types and
1919
operations, concurrency primitives, platform abstractions, I/O, and complete

branches/try/src/libcore/int-template.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,9 @@ pure fn is_nonpositive(x: T) -> bool { x <= 0 as T }
3636
pure fn is_nonnegative(x: T) -> bool { x >= 0 as T }
3737

3838
#[doc = "Iterate over the range [`lo`..`hi`)"]
39-
fn range(lo: T, hi: T, it: fn(T) -> bool) {
39+
fn range(lo: T, hi: T, it: fn(T)) {
4040
let mut i = lo;
41-
while i < hi {
42-
if !it(i) { break }
43-
i += 1 as T;
44-
}
41+
while i < hi { it(i); i += 1 as T; }
4542
}
4643

4744
#[doc = "Computes the bitwise complement"]

branches/try/src/libcore/priv.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ task to receive from it.
2424
unsafe fn chan_from_global_ptr<T: send>(
2525
global: global_ptr,
2626
builder: fn() -> task::builder,
27-
+f: fn~(comm::port<T>)
27+
f: fn~(comm::port<T>)
2828
) -> comm::chan<T> {
2929

3030
enum msg {
@@ -127,12 +127,12 @@ fn test_from_global_chan2() unsafe {
127127

128128
// Spawn a bunch of tasks that all want to compete to
129129
// create the global channel
130-
for uint::range(0u, 10u) {|i|
130+
uint::range(0u, 10u) {|i|
131131
task::spawn() {||
132132
let ch = chan_from_global_ptr(
133133
globchanp, task::builder) {|po|
134134

135-
for uint::range(0u, 10u) {|_j|
135+
uint::range(0u, 10u) {|_j|
136136
let ch = comm::recv(po);
137137
comm::send(ch, {i});
138138
}
@@ -147,7 +147,7 @@ fn test_from_global_chan2() unsafe {
147147
}
148148
// There should be only one winner
149149
let mut winners = 0u;
150-
for uint::range(0u, 10u) {|_i|
150+
uint::range(0u, 10u) {|_i|
151151
let res = comm::recv(resultpo);
152152
if res { winners += 1u };
153153
}
@@ -233,4 +233,4 @@ fn test_weaken_task_fail() unsafe {
233233
}
234234
};
235235
assert result::is_failure(res);
236-
}
236+
}

branches/try/src/libcore/rand.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ impl extensions for rng {
202202
fn weighted_vec<T:copy>(v: [weighted<T>]) -> [T] {
203203
let mut r = [];
204204
for v.each {|item|
205-
for uint::range(0u, item.weight) {|_i|
205+
uint::range(0u, item.weight) {|_i|
206206
r += [item.item];
207207
}
208208
}

branches/try/src/libcore/to_str.rs

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,13 @@
11
iface to_str { fn to_str() -> str; }
22

3-
impl of to_str for i8 {
4-
fn to_str() -> str { i8::str(self) }
3+
impl of to_str for int {
4+
fn to_str() -> str { int::str(self) }
55
}
6-
impl of to_str for i16 {
7-
fn to_str() -> str { i16::str(self) }
8-
}
9-
impl of to_str for i32 {
10-
fn to_str() -> str { i32::str(self) }
11-
}
12-
impl of to_str for i64 {
13-
fn to_str() -> str { i64::str(self) }
6+
impl of to_str for uint {
7+
fn to_str() -> str { uint::str(self) }
148
}
159
impl of to_str for u8 {
16-
fn to_str() -> str { u8::str(self) }
17-
}
18-
impl of to_str for u16 {
19-
fn to_str() -> str { u16::str(self) }
20-
}
21-
impl of to_str for u32 {
22-
fn to_str() -> str { u32::str(self) }
23-
}
24-
impl of to_str for u64 {
25-
fn to_str() -> str { u64::str(self) }
10+
fn to_str() -> str { uint::str(self as uint) }
2611
}
2712
impl of to_str for float {
2813
fn to_str() -> str { float::to_str(self, 4u) }

branches/try/src/libcore/uint-template.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,9 @@ pure fn is_nonpositive(x: T) -> bool { x <= 0 as T }
3535
pure fn is_nonnegative(x: T) -> bool { x >= 0 as T }
3636

3737
#[doc = "Iterate over the range [`lo`..`hi`)"]
38-
fn range(lo: T, hi: T, it: fn(T) -> bool) {
38+
fn range(lo: T, hi: T, it: fn(T)) {
3939
let mut i = lo;
40-
while i < hi {
41-
if !it(i) { break }
42-
i += 1 as T;
43-
}
40+
while i < hi { it(i); i += 1 as T; }
4441
}
4542

4643
#[doc = "Computes the bitwise complement"]

branches/try/src/libcore/vec.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,13 @@ fn from_mut<T>(+v: [mut T]) -> [T] unsafe {
199199
r
200200
}
201201

202+
// This function only exists to work around bugs in the type checker.
203+
fn from_const<T>(+v: [const T]) -> [T] unsafe {
204+
let r = ::unsafe::reinterpret_cast(v);
205+
::unsafe::forget(v);
206+
r
207+
}
208+
202209
// Accessors
203210

204211
#[doc = "Returns the first element of a vector"]
@@ -527,7 +534,7 @@ Flattens a vector of vectors of T into a single vector of T.
527534
"]
528535
fn concat<T: copy>(v: [const [const T]]) -> [T] {
529536
let mut r = [];
530-
for each(v) {|inner| r += inner; }
537+
for each(v) {|inner| r += from_const(inner); }
531538
ret r;
532539
}
533540

@@ -539,7 +546,7 @@ fn connect<T: copy>(v: [const [const T]], sep: T) -> [T] {
539546
let mut first = true;
540547
for each(v) {|inner|
541548
if first { first = false; } else { push(r, sep); }
542-
r += inner;
549+
r += from_const(inner);
543550
}
544551
ret r;
545552
}
@@ -892,7 +899,7 @@ Both vectors must have the same length
892899
#[inline]
893900
fn iter2<U, T>(v1: [const U], v2: [const T], f: fn(U, T)) {
894901
assert len(v1) == len(v2);
895-
for uint::range(0u, len(v1)) {|i|
902+
uint::range(0u, len(v1)) {|i|
896903
f(v1[i], v2[i])
897904
}
898905
}

0 commit comments

Comments
 (0)