Skip to content

Commit 97a2eec

Browse files
committed
---
yaml --- r: 166463 b: refs/heads/snap-stage3 c: f1a3ff0 h: refs/heads/master i: 166461: 23ce22b 166459: 44bb51c 166455: 7c1eb2c 166447: 3ded816 166431: fb814bd 166399: 9385d70 v: v3
1 parent 062ac8c commit 97a2eec

File tree

310 files changed

+5726
-6960
lines changed

Some content is hidden

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

310 files changed

+5726
-6960
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 18842f89f084c52588fe7cffe07f87bf6e90796a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: e64a8193b02ce72ef183274994a25eae281cb89c
4+
refs/heads/snap-stage3: f1a3ff047e386d19238a880b42eb4edacbee0c1b
55
refs/heads/try: f5d619caf9f32458680fae55526b99582ca682dd
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/AUTHORS.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,6 @@ Robert Irelan <[email protected]>
498498
Robert Knight <[email protected]>
499499
Robert Millar <[email protected]>
500500
Roland Tanglao <[email protected]>
501-
Rolf Timmermans <[email protected]>
502501
Ron Dahlgren <[email protected]>
503502
Roy Frostig <[email protected]>
504503

branches/snap-stage3/man/rustc.1

Lines changed: 52 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -12,54 +12,75 @@ This program is a compiler for the Rust language, available at
1212
.SH OPTIONS
1313

1414
.TP
15-
\fB\-h\fR, \fB\-\-help\fR
16-
Display the help message
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`)
1720
.TP
1821
\fB\-\-cfg\fR SPEC
1922
Configure the compilation environment
2023
.TP
21-
\fB\-L\fR PATH
22-
Add a directory to the library search path
23-
.TP
24-
\fB\-l\fR NAME[:KIND]
25-
Link the generated crate(s) to the specified native library NAME. The optional
26-
KIND can be one of, static, dylib, or framework. If omitted, dylib is assumed.
24+
\fB\-\-emit=[asm,ir,bc,obj,link]\fR
25+
Configure the output that rustc will produce
2726
.TP
28-
\fB\-\-crate-type\fR [bin|lib|rlib|dylib|staticlib]
29-
Comma separated list of types of crates for the compiler to emit
27+
\fB\-h\fR, \fB\-\-help\fR
28+
Display this message
3029
.TP
31-
\fB\-\-crate-name NAME\fR
32-
Specify the name of the crate being built
30+
\fB\-L\fR PATH
31+
Add a directory to the library search path
3332
.TP
34-
\fB\-\-emit\fR [asm|llvm-bc|llvm-ir|obj|link|dep-info]
35-
Configure the output that rustc will produce
33+
\fB\-\-no\-trans\fR
34+
Run all passes except translation; no output
3635
.TP
37-
\fB\-\-print\fR [crate-name|output-file-names|sysroot]
38-
Comma separated list of compiler information to print on stdout
36+
\fB\-\-no\-analysis\fR
37+
Parse and expand the source, but run no analysis and produce no output
3938
.TP
4039
\fB\-g\fR
41-
Equivalent to \fI\-C\fR debuginfo=2
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).
4246
.TP
4347
\fB\-O\fR
44-
Equivalent to \fI\-C\fR opt-level=2
48+
Equivalent to \fI\-\-opt\-level=2\fR
4549
.TP
4650
\fB\-o\fR FILENAME
47-
Write output to <filename>. Ignored if multiple \fI\-\-emit\fR outputs are
48-
specified.
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
4955
.TP
5056
\fB\-\-out\-dir\fR DIR
51-
Write output to compiler-chosen filename in <dir>. Ignored if \fI\-o\fR is
52-
specified. Defaults to the current directory.
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
5362
.TP
54-
\fB\-\-explain\fR OPT
55-
Provide a detailed explanation of an error message
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
5676
.TP
5777
\fB\-\-test\fR
5878
Build a test harness
5979
.TP
6080
\fB\-\-target\fR TRIPLE
61-
Target triple cpu-manufacturer-kernel[-os] to compile for (see chapter 3.4 of
62-
http://www.sourceware.org/autobook/ for details)
81+
Target triple cpu-manufacturer-kernel[-os] to compile for (see
82+
http://sources.redhat.com/autobook/autobook/autobook_17.html
83+
for details)
6384
.TP
6485
\fB\-W\fR help
6586
Print 'lint' options and default settings
@@ -76,30 +97,15 @@ Set lint denied
7697
\fB\-F\fR OPT, \fB\-\-forbid\fR OPT
7798
Set lint forbidden
7899
.TP
100+
\fB\-Z\fR FLAG
101+
Set internal debugging options. Use "-Z help" to print available options.
102+
.TP
79103
\fB\-C\fR FLAG[=VAL], \fB\-\-codegen\fR FLAG[=VAL]
80104
Set a codegen-related flag to the value specified. Use "-C help" to print
81105
available flags. See CODEGEN OPTIONS below
82106
.TP
83-
\fB\-V\fR, \fB\-\-version\fR
107+
\fB\-v\fR, \fB\-\-version\fR
84108
Print version info and exit
85-
.TP
86-
\fB\-v\fR, \fB\-\-verbose\fR
87-
Use verbose output
88-
.TP
89-
\fB\-\-extern\fR NAME=PATH
90-
Specify where an external rust library is located
91-
.TP
92-
\fB\-\-sysroot\fR PATH
93-
Override the system root
94-
.TP
95-
\fB\-Z\fR FLAG
96-
Set internal debugging options. Use "-Z help" to print available options.
97-
.TP
98-
\fB\-\-color\fR auto|always|never
99-
Configure coloring of output:
100-
auto = colorize, if output goes to a tty (default);
101-
always = always colorize output;
102-
never = never colorize output
103109

104110
.SH CODEGEN OPTIONS
105111

@@ -115,9 +121,6 @@ objects.
115121
A space-separated list of extra arguments to pass to the linker when the linker
116122
is invoked.
117123
.TP
118-
\fBlto\fR
119-
Perform LLVM link-time optimizations.
120-
.TP
121124
\fBtarget-cpu\fR=help
122125
Selects a target processor. If the value is 'help', then a list of available
123126
CPUs is printed.
@@ -164,38 +167,8 @@ Prefers dynamic linking to static linking.
164167
\fBno-integrated-as\fR
165168
Force usage of an external assembler rather than LLVM's integrated one.
166169
.TP
167-
\fBno-redzone\fR
168-
Disable the use of the redzone.
169-
.TP
170170
\fBrelocation-model\fR=[pic,static,dynamic-no-pic]
171-
The relocation model to use. (Default: pic)
172-
.TP
173-
\fBcode-model\fR=[small,kernel,medium,large]
174-
Choose the code model to use.
175-
.TP
176-
\fBmetadata\fR=val
177-
Metadata to mangle symbol names with.
178-
.TP
179-
\fBextra-filename\fR=val
180-
Extra data to put in each output filename.
181-
.TP
182-
\fBcodegen-units\fR=val
183-
Divide crate into N units to optimize in parallel.
184-
.TP
185-
\fBremark\fR=val
186-
Print remarks for these optimization passes (space separated, or "all").
187-
.TP
188-
\fBno-stack-check\fR
189-
Disable checks for stack exhaustion (a memory-safety hazard!).
190-
.TP
191-
\fBdebuginfo\fR=val
192-
Debug info emission level:
193-
0 = no debug info;
194-
1 = line-tables only (for stacktraces and breakpoints);
195-
2 = full debug info with variable and type information.
196-
.TP
197-
\fBopt-level\fR=val
198-
Optimize with possible levels 0-3
171+
The relocation model to use. (default: pic)
199172

200173
.SH "EXAMPLES"
201174
To build an executable from a source file with a main function:

branches/snap-stage3/mk/rt.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
# that's per-target so you're allowed to conditionally add files based on the
3636
# target.
3737
################################################################################
38-
NATIVE_LIBS := rust_builtin hoedown morestack miniz \
38+
NATIVE_LIBS := rust_builtin hoedown morestack miniz context_switch \
3939
rustrt_native rust_test_helpers
4040

4141
# $(1) is the target triple
@@ -58,7 +58,8 @@ NATIVE_DEPS_rustrt_native_$(1) := \
5858
arch/$$(HOST_$(1))/record_sp.S
5959
NATIVE_DEPS_rust_test_helpers_$(1) := rust_test_helpers.c
6060
NATIVE_DEPS_morestack_$(1) := arch/$$(HOST_$(1))/morestack.S
61-
61+
NATIVE_DEPS_context_switch_$(1) := \
62+
arch/$$(HOST_$(1))/_context.S
6263

6364
################################################################################
6465
# You shouldn't find it that necessary to edit anything below this line.

branches/snap-stage3/src/compiletest/compiletest.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
152152
matches.opt_str("ratchet-metrics").map(|s| Path::new(s)),
153153
ratchet_noise_percent:
154154
matches.opt_str("ratchet-noise-percent")
155-
.and_then(|s| s.as_slice().parse::<f64>()),
155+
.and_then(|s| from_str::<f64>(s.as_slice())),
156156
runtool: matches.opt_str("runtool"),
157157
host_rustcflags: matches.opt_str("host-rustcflags"),
158158
target_rustcflags: matches.opt_str("target-rustcflags"),
@@ -190,7 +190,9 @@ pub fn log_config(config: &Config) {
190190
logv(c, format!("filter: {}",
191191
opt_str(&config.filter
192192
.as_ref()
193-
.map(|re| re.to_string()))));
193+
.map(|re| {
194+
re.to_string().into_string()
195+
}))));
194196
logv(c, format!("runtool: {}", opt_str(&config.runtool)));
195197
logv(c, format!("host-rustcflags: {}",
196198
opt_str(&config.host_rustcflags)));

branches/snap-stage3/src/compiletest/header.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,8 @@ pub fn gdb_version_to_int(version_string: &str) -> int {
351351
panic!("{}", error_string);
352352
}
353353

354-
let major: int = components[0].parse().expect(error_string);
355-
let minor: int = components[1].parse().expect(error_string);
354+
let major: int = from_str(components[0]).expect(error_string);
355+
let minor: int = from_str(components[1]).expect(error_string);
356356

357357
return major * 1000 + minor;
358358
}
@@ -362,6 +362,6 @@ pub fn lldb_version_to_int(version_string: &str) -> int {
362362
"Encountered LLDB version string with unexpected format: {}",
363363
version_string);
364364
let error_string = error_string.as_slice();
365-
let major: int = version_string.parse().expect(error_string);
365+
let major: int = from_str(version_string).expect(error_string);
366366
return major;
367367
}

branches/snap-stage3/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,7 @@ fn split_maybe_args(argstr: &Option<String>) -> Vec<String> {
13611361
s.as_slice()
13621362
.split(' ')
13631363
.filter_map(|s| {
1364-
if s.chars().all(|c| c.is_whitespace()) {
1364+
if s.is_whitespace() {
13651365
None
13661366
} else {
13671367
Some(s.to_string())

branches/snap-stage3/src/doc/complement-bugreport.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ miss out on valid bug reports.
3434
It generally helps our diagnosis to include your specific OS (for example: Mac OS X 10.8.3,
3535
Windows 7, Ubuntu 12.04) and your hardware architecture (for example: i686, x86_64).
3636
It's also helpful to provide the exact version and host by copying the output of
37-
re-running the erroneous rustc command with the `--version --verbose` flags, which will
37+
re-running the erroneous rustc command with the `--version=verbose` flag, which will
3838
produce something like this:
3939

4040
```text

branches/snap-stage3/src/doc/guide.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,8 +1010,8 @@ in the original declaration.
10101010
Finally, because fields have names, we can access the field through dot
10111011
notation: `origin.x`.
10121012

1013-
The values in structs are immutable by default, like other bindings in Rust.
1014-
Use `mut` to make them mutable:
1013+
The values in structs are immutable, like other bindings in Rust. However, you
1014+
can use `mut` to make them mutable:
10151015

10161016
```{rust}
10171017
struct Point {
@@ -2257,10 +2257,10 @@ a function for that:
22572257
let input = io::stdin().read_line()
22582258
.ok()
22592259
.expect("Failed to read line");
2260-
let input_num: Option<uint> = input.parse();
2260+
let input_num: Option<uint> = from_str(input.as_slice());
22612261
```
22622262
2263-
The `parse` function takes in a `&str` value and converts it into something.
2263+
The `from_str` function takes in a `&str` value and converts it into something.
22642264
We tell it what kind of something with a type hint. Remember our type hint with
22652265
`random()`? It looked like this:
22662266
@@ -2279,8 +2279,8 @@ In this case, we say `x` is a `uint` explicitly, so Rust is able to properly
22792279
tell `random()` what to generate. In a similar fashion, both of these work:
22802280
22812281
```{rust,ignore}
2282-
let input_num = "5".parse::<uint>(); // input_num: Option<uint>
2283-
let input_num: Option<uint> = "5".parse(); // input_num: Option<uint>
2282+
let input_num = from_str::<uint>("5"); // input_num: Option<uint>
2283+
let input_num: Option<uint> = from_str("5"); // input_num: Option<uint>
22842284
```
22852285
22862286
Anyway, with us now converting our input to a number, our code looks like this:
@@ -2301,7 +2301,7 @@ fn main() {
23012301
let input = io::stdin().read_line()
23022302
.ok()
23032303
.expect("Failed to read line");
2304-
let input_num: Option<uint> = input.parse();
2304+
let input_num: Option<uint> = from_str(input.as_slice());
23052305

23062306
println!("You guessed: {}", input_num);
23072307

@@ -2350,7 +2350,7 @@ fn main() {
23502350
let input = io::stdin().read_line()
23512351
.ok()
23522352
.expect("Failed to read line");
2353-
let input_num: Option<uint> = input.parse();
2353+
let input_num: Option<uint> = from_str(input.as_slice());
23542354
23552355
let num = match input_num {
23562356
Some(num) => num,
@@ -2395,7 +2395,7 @@ Uh, what? But we did!
23952395
23962396
... actually, we didn't. See, when you get a line of input from `stdin()`,
23972397
you get all the input. Including the `\n` character from you pressing Enter.
2398-
Therefore, `parse()` sees the string `"5\n"` and says "nope, that's not a
2398+
Therefore, `from_str()` sees the string `"5\n"` and says "nope, that's not a
23992399
number; there's non-number stuff in there!" Luckily for us, `&str`s have an easy
24002400
method we can use defined on them: `trim()`. One small modification, and our
24012401
code looks like this:
@@ -2416,7 +2416,7 @@ fn main() {
24162416
let input = io::stdin().read_line()
24172417
.ok()
24182418
.expect("Failed to read line");
2419-
let input_num: Option<uint> = input.trim().parse();
2419+
let input_num: Option<uint> = from_str(input.as_slice().trim());
24202420
24212421
let num = match input_num {
24222422
Some(num) => num,
@@ -2491,7 +2491,7 @@ fn main() {
24912491
let input = io::stdin().read_line()
24922492
.ok()
24932493
.expect("Failed to read line");
2494-
let input_num: Option<uint> = input.trim().parse();
2494+
let input_num: Option<uint> = from_str(input.as_slice().trim());
24952495

24962496
let num = match input_num {
24972497
Some(num) => num,
@@ -2566,7 +2566,7 @@ fn main() {
25662566
let input = io::stdin().read_line()
25672567
.ok()
25682568
.expect("Failed to read line");
2569-
let input_num: Option<uint> = input.trim().parse();
2569+
let input_num: Option<uint> = from_str(input.as_slice().trim());
25702570
25712571
let num = match input_num {
25722572
Some(num) => num,
@@ -2621,7 +2621,7 @@ fn main() {
26212621
let input = io::stdin().read_line()
26222622
.ok()
26232623
.expect("Failed to read line");
2624-
let input_num: Option<uint> = input.trim().parse();
2624+
let input_num: Option<uint> = from_str(input.as_slice().trim());
26252625
26262626
let num = match input_num {
26272627
Some(num) => num,
@@ -2697,7 +2697,7 @@ fn main() {
26972697
let input = io::stdin().read_line()
26982698
.ok()
26992699
.expect("Failed to read line");
2700-
let input_num: Option<uint> = input.trim().parse();
2700+
let input_num: Option<uint> = from_str(input.as_slice().trim());
27012701
27022702
let num = match input_num {
27032703
Some(num) => num,

branches/snap-stage3/src/doc/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3177,7 +3177,7 @@ Some examples of call expressions:
31773177
# fn add(x: int, y: int) -> int { 0 }
31783178
31793179
let x: int = add(1, 2);
3180-
let pi: Option<f32> = "3.14".parse();
3180+
let pi: Option<f32> = from_str("3.14");
31813181
```
31823182

31833183
### Lambda expressions

0 commit comments

Comments
 (0)