Skip to content

Commit 8833c32

Browse files
committed
---
yaml --- r: 177614 b: refs/heads/auto c: a19d336 h: refs/heads/master v: v3
1 parent 28e9002 commit 8833c32

File tree

530 files changed

+6656
-4072
lines changed

Some content is hidden

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

530 files changed

+6656
-4072
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: e2282f9cfbf47fcbc0cf637507215dadb8cb1fc5
13+
refs/heads/auto: a19d3368e1b4e505b60c5267e3065f061e126d18
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/AUTHORS.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ Olivier Saut <[email protected]>
516516
Olle Jonsson <[email protected]>
517517
Or Brostovski <[email protected]>
518518
Oren Hazi <[email protected]>
519-
Orpheus Lummis <o@orpheuslummis.com>
519+
Orphée Lafond-Lummis <o@orftz.com>
520520
521521
Pablo Brasero <[email protected]>
522522
Palmer Cox <[email protected]>

branches/auto/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ example, if it's 2014, and you change a Rust file that was created in
5050
# Coordination and communication
5151

5252
Get feedback from other developers on
53-
[internals.rust-lang.org][internals], and
53+
[discuss.rust-lang.org][discuss], and
5454
[#rust-internals][pound-rust-internals].
5555

5656
[pound-rust-internals]: http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-internals
57-
[internals]: http://internals.rust-lang.org
57+
[discuss]: http://discuss.rust-lang.org
5858

5959
For more details, please refer to
6060
[Note-development-policy](https://github.com/rust-lang/rust/wiki/Note-development-policy).

branches/auto/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ documentation.
3030

3131
To build from the [tarball] do:
3232

33-
$ curl -O https://static.rust-lang.org/dist/rustc-nightly-src.tar.gz
34-
$ tar -xzf rustc-nightly-src.tar.gz
35-
$ cd rustc-nightly
33+
$ curl -O https://static.rust-lang.org/dist/rust-nightly.tar.gz
34+
$ tar -xzf rust-nightly.tar.gz
35+
$ cd rust-nightly
3636

3737
Or to build from the [repo] do:
3838

@@ -80,7 +80,7 @@ $ pacman -S base-devel
8080
$ make && make install
8181

8282
[repo]: https://github.com/rust-lang/rust
83-
[tarball]: https://static.rust-lang.org/dist/rustc-nightly-src.tar.gz
83+
[tarball]: https://static.rust-lang.org/dist/rust-nightly.tar.gz
8484
[trpl]: http://doc.rust-lang.org/book/index.html
8585

8686
## Notes
@@ -112,11 +112,11 @@ The Rust community congregates in a few places:
112112

113113
* [StackOverflow] - Get help here.
114114
* [/r/rust] - General discussion.
115-
* [internals.rust-lang.org] - For development of the Rust language itself.
115+
* [discuss.rust-lang.org] - For development of the Rust language itself.
116116

117117
[StackOverflow]: http://stackoverflow.com/questions/tagged/rust
118118
[/r/rust]: http://reddit.com/r/rust
119-
[internals.rust-lang.org]: http://internals.rust-lang.org/
119+
[discuss.rust-lang.org]: http://discuss.rust-lang.org/
120120

121121
## License
122122

branches/auto/src/compiletest/common.rs

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@ pub use self::Mode::*;
1212
use std::fmt;
1313
use std::str::FromStr;
1414

15+
#[cfg(stage0)] // NOTE: remove impl after snapshot
16+
#[derive(Clone, Copy, PartialEq, Show)]
17+
pub enum Mode {
18+
CompileFail,
19+
RunFail,
20+
RunPass,
21+
RunPassValgrind,
22+
Pretty,
23+
DebugInfoGdb,
24+
DebugInfoLldb,
25+
Codegen
26+
}
27+
28+
#[cfg(not(stage0))] // NOTE: remove cfg after snapshot
1529
#[derive(Clone, Copy, PartialEq, Debug)]
1630
pub enum Mode {
1731
CompileFail,
@@ -25,18 +39,17 @@ pub enum Mode {
2539
}
2640

2741
impl FromStr for Mode {
28-
type Err = ();
29-
fn from_str(s: &str) -> Result<Mode, ()> {
42+
fn from_str(s: &str) -> Option<Mode> {
3043
match s {
31-
"compile-fail" => Ok(CompileFail),
32-
"run-fail" => Ok(RunFail),
33-
"run-pass" => Ok(RunPass),
34-
"run-pass-valgrind" => Ok(RunPassValgrind),
35-
"pretty" => Ok(Pretty),
36-
"debuginfo-lldb" => Ok(DebugInfoLldb),
37-
"debuginfo-gdb" => Ok(DebugInfoGdb),
38-
"codegen" => Ok(Codegen),
39-
_ => Err(()),
44+
"compile-fail" => Some(CompileFail),
45+
"run-fail" => Some(RunFail),
46+
"run-pass" => Some(RunPass),
47+
"run-pass-valgrind" => Some(RunPassValgrind),
48+
"pretty" => Some(Pretty),
49+
"debuginfo-lldb" => Some(DebugInfoLldb),
50+
"debuginfo-gdb" => Some(DebugInfoGdb),
51+
"codegen" => Some(Codegen),
52+
_ => None,
4053
}
4154
}
4255
}

branches/auto/src/compiletest/compiletest.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#![feature(os)]
2424
#![feature(unicode)]
2525

26-
#![allow(unstable)]
2726
#![deny(warnings)]
2827

2928
extern crate test;
@@ -35,6 +34,7 @@ extern crate log;
3534
use std::os;
3635
use std::old_io;
3736
use std::old_io::fs;
37+
use std::str::FromStr;
3838
use std::thunk::Thunk;
3939
use getopts::{optopt, optflag, reqopt};
4040
use common::Config;
@@ -139,7 +139,9 @@ pub fn parse_config(args: Vec<String> ) -> Config {
139139
build_base: opt_path(matches, "build-base"),
140140
aux_base: opt_path(matches, "aux-base"),
141141
stage_id: matches.opt_str("stage-id").unwrap(),
142-
mode: matches.opt_str("mode").unwrap().parse().ok().expect("invalid mode"),
142+
mode: FromStr::from_str(matches.opt_str("mode")
143+
.unwrap()
144+
.as_slice()).expect("invalid mode"),
143145
run_ignored: matches.opt_present("ignored"),
144146
filter: filter,
145147
logfile: matches.opt_str("logfile").map(|s| Path::new(s)),
@@ -367,8 +369,8 @@ pub fn make_metrics_test_closure(config: &Config, testfile: &Path) -> test::Test
367369
fn extract_gdb_version(full_version_line: Option<String>) -> Option<String> {
368370
match full_version_line {
369371
Some(ref full_version_line)
370-
if full_version_line.trim().len() > 0 => {
371-
let full_version_line = full_version_line.trim();
372+
if full_version_line.as_slice().trim().len() > 0 => {
373+
let full_version_line = full_version_line.as_slice().trim();
372374

373375
// used to be a regex "(^|[^0-9])([0-9]\.[0-9])([^0-9]|$)"
374376
for (pos, c) in full_version_line.char_indices() {
@@ -407,8 +409,8 @@ fn extract_lldb_version(full_version_line: Option<String>) -> Option<String> {
407409

408410
match full_version_line {
409411
Some(ref full_version_line)
410-
if full_version_line.trim().len() > 0 => {
411-
let full_version_line = full_version_line.trim();
412+
if full_version_line.as_slice().trim().len() > 0 => {
413+
let full_version_line = full_version_line.as_slice().trim();
412414

413415
for (pos, l) in full_version_line.char_indices() {
414416
if l != 'l' && l != 'L' { continue }

branches/auto/src/compiletest/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub struct ExpectedError {
1717
pub msg: String,
1818
}
1919

20-
#[derive(PartialEq, Debug)]
20+
#[derive(PartialEq, Show)]
2121
enum WhichLine { ThisLine, FollowPrevious(uint), AdjustBackward(uint) }
2222

2323
/// Looks for either "//~| KIND MESSAGE" or "//~^^... KIND MESSAGE"

branches/auto/src/compiletest/header.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ pub fn is_test_ignored(config: &Config, testfile: &Path) -> bool {
149149
}
150150
fn ignore_stage(config: &Config) -> String {
151151
format!("ignore-{}",
152-
config.stage_id.split('-').next().unwrap())
152+
config.stage_id.as_slice().split('-').next().unwrap())
153153
}
154154
fn ignore_gdb(config: &Config, line: &str) -> bool {
155155
if config.mode != common::DebugInfoGdb {
@@ -231,11 +231,11 @@ fn iter_header<F>(testfile: &Path, mut it: F) -> bool where
231231
// module or function. This doesn't seem to be an optimization
232232
// with a warm page cache. Maybe with a cold one.
233233
let ln = ln.unwrap();
234-
if ln.starts_with("fn") ||
235-
ln.starts_with("mod") {
234+
if ln.as_slice().starts_with("fn") ||
235+
ln.as_slice().starts_with("mod") {
236236
return true;
237237
} else {
238-
if !(it(ln.trim())) {
238+
if !(it(ln.as_slice().trim())) {
239239
return false;
240240
}
241241
}
@@ -352,8 +352,8 @@ pub fn gdb_version_to_int(version_string: &str) -> int {
352352
panic!("{}", error_string);
353353
}
354354

355-
let major: int = components[0].parse().ok().expect(error_string);
356-
let minor: int = components[1].parse().ok().expect(error_string);
355+
let major: int = components[0].parse().expect(error_string);
356+
let minor: int = components[1].parse().expect(error_string);
357357

358358
return major * 1000 + minor;
359359
}
@@ -363,6 +363,6 @@ pub fn lldb_version_to_int(version_string: &str) -> int {
363363
"Encountered LLDB version string with unexpected format: {}",
364364
version_string);
365365
let error_string = error_string.as_slice();
366-
let major: int = version_string.parse().ok().expect(error_string);
366+
let major: int = version_string.parse().expect(error_string);
367367
return major;
368368
}

branches/auto/src/compiletest/runtest.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ fn parse_debugger_commands(file_path: &Path, debugger_prefix: &str)
777777
for line in reader.lines() {
778778
match line {
779779
Ok(line) => {
780-
if line.contains("#break") {
780+
if line.as_slice().contains("#break") {
781781
breakpoint_lines.push(counter);
782782
}
783783

@@ -843,7 +843,7 @@ fn check_debugger_output(debugger_run_result: &ProcRes, check_lines: &[String])
843843
// check if each line in props.check_lines appears in the
844844
// output (in order)
845845
let mut i = 0u;
846-
for line in debugger_run_result.stdout.lines() {
846+
for line in debugger_run_result.stdout.as_slice().lines() {
847847
let mut rest = line.trim();
848848
let mut first = true;
849849
let mut failed = false;
@@ -895,7 +895,7 @@ fn check_error_patterns(props: &TestProps,
895895
let mut next_err_idx = 0u;
896896
let mut next_err_pat = &props.error_patterns[next_err_idx];
897897
let mut done = false;
898-
for line in output_to_check.lines() {
898+
for line in output_to_check.as_slice().lines() {
899899
if line.contains(next_err_pat.as_slice()) {
900900
debug!("found error pattern {}", next_err_pat);
901901
next_err_idx += 1u;
@@ -924,7 +924,7 @@ fn check_error_patterns(props: &TestProps,
924924
}
925925

926926
fn check_no_compiler_crash(proc_res: &ProcRes) {
927-
for line in proc_res.stderr.lines() {
927+
for line in proc_res.stderr.as_slice().lines() {
928928
if line.starts_with("error: internal compiler error:") {
929929
fatal_proc_rec("compiler encountered internal error",
930930
proc_res);
@@ -983,7 +983,7 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
983983
// filename:line1:col1: line2:col2: *warning:* msg
984984
// where line1:col1: is the starting point, line2:col2:
985985
// is the ending point, and * represents ANSI color codes.
986-
for line in proc_res.stderr.lines() {
986+
for line in proc_res.stderr.as_slice().lines() {
987987
let mut was_expected = false;
988988
for (i, ee) in expected_errors.iter().enumerate() {
989989
if !found_flags[i] {
@@ -1536,7 +1536,7 @@ fn _arm_exec_compiled_test(config: &Config,
15361536
.expect(format!("failed to exec `{}`", config.adb_path).as_slice());
15371537

15381538
let mut exitcode: int = 0;
1539-
for c in exitcode_out.chars() {
1539+
for c in exitcode_out.as_slice().chars() {
15401540
if !c.is_numeric() { break; }
15411541
exitcode = exitcode * 10 + match c {
15421542
'0' ... '9' => c as int - ('0' as int),

branches/auto/src/doc/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ problem might reveal someone who has asked it before!
4141
There is an active [subreddit](http://reddit.com/r/rust) with lots of
4242
discussion about Rust.
4343

44-
There is also a [developer forum](http://internals.rust-lang.org/), where the
44+
There is also a [developer forum](http://discuss.rust-lang.org/), where the
4545
development of Rust itself is discussed.
4646

4747
# Specification

branches/auto/src/doc/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2994,7 +2994,7 @@ Some examples of call expressions:
29942994
# fn add(x: i32, y: i32) -> i32 { 0 }
29952995
29962996
let x: i32 = add(1i32, 2i32);
2997-
let pi: Option<f32> = "3.14".parse().ok();
2997+
let pi: Option<f32> = "3.14".parse();
29982998
```
29992999

30003000
### Lambda expressions

branches/auto/src/doc/trpl/error-handling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ for all but the most trivial of situations.
147147
Here's an example of using `Result`:
148148

149149
```rust
150-
#[derive(Debug)]
150+
#[derive(Show)]
151151
enum Version { Version1, Version2 }
152152

153-
#[derive(Debug)]
153+
#[derive(Show)]
154154
enum ParseError { InvalidHeaderLength, InvalidVersion }
155155

156156
fn parse_version(header: &[u8]) -> Result<Version, ParseError> {

branches/auto/src/doc/trpl/guessing-game.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ a function for that:
400400
let input = old_io::stdin().read_line()
401401
.ok()
402402
.expect("Failed to read line");
403-
let input_num: Option<u32> = input.parse().ok();
403+
let input_num: Option<u32> = input.parse();
404404
```
405405
406406
The `parse` function takes in a `&str` value and converts it into something.
@@ -422,13 +422,11 @@ In this case, we say `x` is a `u32` explicitly, so Rust is able to properly
422422
tell `random()` what to generate. In a similar fashion, both of these work:
423423
424424
```{rust,ignore}
425-
let input_num = "5".parse::<u32>().ok(); // input_num: Option<u32>
426-
let input_num: Option<u32> = "5".parse().ok(); // input_num: Option<u32>
425+
let input_num = "5".parse::<u32>(); // input_num: Option<u32>
426+
let input_num: Option<u32> = "5".parse(); // input_num: Option<u32>
427427
```
428428
429-
Here we're converting the `Result` returned by `parse` to an `Option` by using
430-
the `ok` method as well. Anyway, with us now converting our input to a number,
431-
our code looks like this:
429+
Anyway, with us now converting our input to a number, our code looks like this:
432430
433431
```{rust,ignore}
434432
use std::old_io;
@@ -447,7 +445,7 @@ fn main() {
447445
let input = old_io::stdin().read_line()
448446
.ok()
449447
.expect("Failed to read line");
450-
let input_num: Option<u32> = input.parse().ok();
448+
let input_num: Option<u32> = input.parse();
451449

452450
println!("You guessed: {}", input_num);
453451

@@ -497,7 +495,7 @@ fn main() {
497495
let input = old_io::stdin().read_line()
498496
.ok()
499497
.expect("Failed to read line");
500-
let input_num: Option<u32> = input.parse().ok();
498+
let input_num: Option<u32> = input.parse();
501499
502500
let num = match input_num {
503501
Some(num) => num,
@@ -564,7 +562,7 @@ fn main() {
564562
let input = old_io::stdin().read_line()
565563
.ok()
566564
.expect("Failed to read line");
567-
let input_num: Option<u32> = input.trim().parse().ok();
565+
let input_num: Option<u32> = input.trim().parse();
568566
569567
let num = match input_num {
570568
Some(num) => num,
@@ -640,7 +638,7 @@ fn main() {
640638
let input = old_io::stdin().read_line()
641639
.ok()
642640
.expect("Failed to read line");
643-
let input_num: Option<u32> = input.trim().parse().ok();
641+
let input_num: Option<u32> = input.trim().parse();
644642

645643
let num = match input_num {
646644
Some(num) => num,
@@ -716,7 +714,7 @@ fn main() {
716714
let input = old_io::stdin().read_line()
717715
.ok()
718716
.expect("Failed to read line");
719-
let input_num: Option<u32> = input.trim().parse().ok();
717+
let input_num: Option<u32> = input.trim().parse();
720718
721719
let num = match input_num {
722720
Some(num) => num,
@@ -772,7 +770,7 @@ fn main() {
772770
let input = old_io::stdin().read_line()
773771
.ok()
774772
.expect("Failed to read line");
775-
let input_num: Option<u32> = input.trim().parse().ok();
773+
let input_num: Option<u32> = input.trim().parse();
776774
777775
let num = match input_num {
778776
Some(num) => num,
@@ -849,7 +847,7 @@ fn main() {
849847
let input = old_io::stdin().read_line()
850848
.ok()
851849
.expect("Failed to read line");
852-
let input_num: Option<u32> = input.trim().parse().ok();
850+
let input_num: Option<u32> = input.trim().parse();
853851
854852
let num = match input_num {
855853
Some(num) => num,

0 commit comments

Comments
 (0)