Skip to content

Commit 7914911

Browse files
committed
---
yaml --- r: 177919 b: refs/heads/snap-stage3 c: a75e308 h: refs/heads/master i: 177917: 9102f50 177915: 878bc07 177911: 4f3ae26 177903: 7cbb792 177887: ab5e8e6 177855: 5e6ccf7 177791: 6629b61 177663: cb5c1c4 v: v3
1 parent bc8484a commit 7914911

File tree

180 files changed

+2267
-4789
lines changed

Some content is hidden

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

180 files changed

+2267
-4789
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: 474b324eda10440d6568ef872a7307d38e7de95b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 19a1f7ed06d3f4f3b64cb4417f7159cd59f38ae7
4+
refs/heads/snap-stage3: a75e308a61be8cc64ed19214daa979c049e7c459
55
refs/heads/try: fde4472848b662a4d1236388c4cf15e2450237e6
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,14 @@ There is a lot more documentation in the [wiki].
110110

111111
The Rust community congregates in a few places:
112112

113-
* [StackOverflow] - Get help here.
114-
* [/r/rust] - General discussion.
113+
* [StackOverflow] - Direct questions about using the language here.
114+
* [users.rust-lang.org] - General discussion, broader questions.
115115
* [internals.rust-lang.org] - For development of the Rust language itself.
116+
* [/r/rust] - News and general discussion.
116117

117118
[StackOverflow]: http://stackoverflow.com/questions/tagged/rust
118119
[/r/rust]: http://reddit.com/r/rust
120+
[users.rust-lang.org]: http://users.rust-lang.org/
119121
[internals.rust-lang.org]: http://internals.rust-lang.org/
120122

121123
## License

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,18 @@ pub enum Mode {
2525
}
2626

2727
impl FromStr for Mode {
28-
fn from_str(s: &str) -> Option<Mode> {
28+
type Err = ();
29+
fn from_str(s: &str) -> Result<Mode, ()> {
2930
match s {
30-
"compile-fail" => Some(CompileFail),
31-
"run-fail" => Some(RunFail),
32-
"run-pass" => Some(RunPass),
33-
"run-pass-valgrind" => Some(RunPassValgrind),
34-
"pretty" => Some(Pretty),
35-
"debuginfo-lldb" => Some(DebugInfoLldb),
36-
"debuginfo-gdb" => Some(DebugInfoGdb),
37-
"codegen" => Some(Codegen),
38-
_ => None,
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(()),
3940
}
4041
}
4142
}

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ extern crate log;
3535
use std::os;
3636
use std::old_io;
3737
use std::old_io::fs;
38-
use std::str::FromStr;
3938
use std::thunk::Thunk;
4039
use getopts::{optopt, optflag, reqopt};
4140
use common::Config;
@@ -140,9 +139,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
140139
build_base: opt_path(matches, "build-base"),
141140
aux_base: opt_path(matches, "aux-base"),
142141
stage_id: matches.opt_str("stage-id").unwrap(),
143-
mode: FromStr::from_str(matches.opt_str("mode")
144-
.unwrap()
145-
.as_slice()).expect("invalid mode"),
142+
mode: matches.opt_str("mode").unwrap().parse().ok().expect("invalid mode"),
146143
run_ignored: matches.opt_present("ignored"),
147144
filter: filter,
148145
logfile: matches.opt_str("logfile").map(|s| Path::new(s)),

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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().expect(error_string);
356-
let minor: int = components[1].parse().expect(error_string);
355+
let major: int = components[0].parse().ok().expect(error_string);
356+
let minor: int = components[1].parse().ok().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().expect(error_string);
366+
let major: int = version_string.parse().ok().expect(error_string);
367367
return major;
368368
}

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ Overflow](http://stackoverflow.com/questions/tagged/rust). Searching for your
3939
problem might reveal someone who has asked it before!
4040

4141
There is an active [subreddit](http://reddit.com/r/rust) with lots of
42-
discussion about Rust.
42+
discussion and news about Rust.
4343

44-
There is also a [developer forum](http://internals.rust-lang.org/), where the
45-
development of Rust itself is discussed.
44+
There is also a [user forum](http://users.rust-lang.org), for all
45+
user-oriented discussion, and a [developer
46+
forum](http://internals.rust-lang.org/), where the development of Rust
47+
itself is discussed.
4648

4749
# Specification
4850

branches/snap-stage3/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();
2997+
let pi: Option<f32> = "3.14".parse().ok();
29982998
```
29992999

30003000
### Lambda expressions

branches/snap-stage3/src/doc/trpl/guessing-game.md

Lines changed: 13 additions & 11 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();
403+
let input_num: Option<u32> = input.parse().ok();
404404
```
405405
406406
The `parse` function takes in a `&str` value and converts it into something.
@@ -422,11 +422,13 @@ 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>(); // input_num: Option<u32>
426-
let input_num: Option<u32> = "5".parse(); // input_num: Option<u32>
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>
427427
```
428428
429-
Anyway, with us now converting our input to a number, our code looks like this:
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:
430432
431433
```{rust,ignore}
432434
use std::old_io;
@@ -445,7 +447,7 @@ fn main() {
445447
let input = old_io::stdin().read_line()
446448
.ok()
447449
.expect("Failed to read line");
448-
let input_num: Option<u32> = input.parse();
450+
let input_num: Option<u32> = input.parse().ok();
449451
450452
println!("You guessed: {}", input_num);
451453
@@ -495,7 +497,7 @@ fn main() {
495497
let input = old_io::stdin().read_line()
496498
.ok()
497499
.expect("Failed to read line");
498-
let input_num: Option<u32> = input.parse();
500+
let input_num: Option<u32> = input.parse().ok();
499501

500502
let num = match input_num {
501503
Some(num) => num,
@@ -562,7 +564,7 @@ fn main() {
562564
let input = old_io::stdin().read_line()
563565
.ok()
564566
.expect("Failed to read line");
565-
let input_num: Option<u32> = input.trim().parse();
567+
let input_num: Option<u32> = input.trim().parse().ok();
566568

567569
let num = match input_num {
568570
Some(num) => num,
@@ -638,7 +640,7 @@ fn main() {
638640
let input = old_io::stdin().read_line()
639641
.ok()
640642
.expect("Failed to read line");
641-
let input_num: Option<u32> = input.trim().parse();
643+
let input_num: Option<u32> = input.trim().parse().ok();
642644
643645
let num = match input_num {
644646
Some(num) => num,
@@ -714,7 +716,7 @@ fn main() {
714716
let input = old_io::stdin().read_line()
715717
.ok()
716718
.expect("Failed to read line");
717-
let input_num: Option<u32> = input.trim().parse();
719+
let input_num: Option<u32> = input.trim().parse().ok();
718720

719721
let num = match input_num {
720722
Some(num) => num,
@@ -770,7 +772,7 @@ fn main() {
770772
let input = old_io::stdin().read_line()
771773
.ok()
772774
.expect("Failed to read line");
773-
let input_num: Option<u32> = input.trim().parse();
775+
let input_num: Option<u32> = input.trim().parse().ok();
774776

775777
let num = match input_num {
776778
Some(num) => num,
@@ -847,7 +849,7 @@ fn main() {
847849
let input = old_io::stdin().read_line()
848850
.ok()
849851
.expect("Failed to read line");
850-
let input_num: Option<u32> = input.trim().parse();
852+
let input_num: Option<u32> = input.trim().parse().ok();
851853

852854
let num = match input_num {
853855
Some(num) => num,

branches/snap-stage3/src/doc/trpl/unsafe.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,10 @@ extern fn panic_fmt(args: &core::fmt::Arguments,
576576
#[lang = "eh_personality"] extern fn eh_personality() {}
577577
# #[start] fn start(argc: isize, argv: *const *const u8) -> isize { 0 }
578578
# fn main() {}
579+
# mod std { // for-loops
580+
# pub use core::iter;
581+
# pub use core::option;
582+
# }
579583
```
580584

581585
Note that there is one extra lang item here which differs from the examples

branches/snap-stage3/src/etc/emacs/README.md

Lines changed: 0 additions & 79 deletions
This file was deleted.

branches/snap-stage3/src/etc/emacs/run_rust_emacs_tests.sh

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)