Skip to content

Rolling up PRs in the queue #21791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 77 commits into from
Jan 31, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
e371d23
add next/prev section links in the book -- using js
jatinn Jan 22, 2015
ab5c330
str: make replace() example more simple
tshepang Jan 22, 2015
ec4981e
Thread native name setting, fix #10302
vojtechkral Jan 27, 2015
c155208
Thread native name setting, fix #10302
vojtechkral Jan 27, 2015
093926e
Check and extract bindings from trait definitions.
nikomatsakis Jan 27, 2015
83f8088
Add an implementation of Zeroable for Unique<T>
reem Jan 27, 2015
76d66ba
Use unsigned comparison operators for unsigned SIMD types.
huonw Jan 28, 2015
33a3d6d
Thread native name setting, fix #10302
vojtechkral Jan 28, 2015
7e67eba
Thread native name setting, fix #10302
vojtechkral Jan 28, 2015
9ee972c
Thread native name setting, fix #10302
vojtechkral Jan 28, 2015
ca0e83c
Fix wrong use std::io -> old_io
mneumann Jan 29, 2015
26276f4
Fix up check to bypass internal buffer
sfackler Jan 29, 2015
017b3a5
Pull configs out into individual repositories
steveklabnik Jan 29, 2015
a19d336
rustc: Print out a prettier version of crate types
alexcrichton Jan 29, 2015
947f6ca
Feature gate macro_reexport. Fixes #20906
flaper87 Jan 27, 2015
f1ace34
Make subtyping for projection types stricter. Fixes #21726.
nikomatsakis Jan 29, 2015
d8e1236
Fix unknown option message for -Z
dzamlo Jan 29, 2015
1cf684c
rustdoc: Render new `self` syntax in `use`
tomjakubowski Jan 27, 2015
127c253
save-analysis: don't include the crate name in fully qualified paths
nrc Jan 16, 2015
1174550
save-analysis: Use the correct span for `extern crate`
nrc Jan 19, 2015
dcbd418
save-analysis: handle absolute paths properly
nrc Jan 19, 2015
78f6178
save-anlaysis: misc bug fixes
nrc Jan 20, 2015
b159d9c
Make the save-analysis smoke test more thorough
nrc Jan 20, 2015
9ba9966
Review changes
nrc Jan 28, 2015
03b9995
Register snaps
brson Jan 29, 2015
5716ede
doc: Add links to users.rust-lang.org
brson Jan 29, 2015
39a8c23
Make the naming lints only warn on names with upper/lowercase equival…
ftxqxd Dec 6, 2014
7f64fe4
Remove all `i` suffixes
tbu- Jan 25, 2015
a65d3f5
core: add the `IntoIterator` trait
Jan 8, 2015
9fdc0ef
implement for loop desugaring
Jan 8, 2015
f9865ea
fix fallout
Jan 11, 2015
5e1820f
fix tests
Jan 23, 2015
76362f0
custom message for refutable patterns in for loops
Jan 22, 2015
acb8c1a
remove more `ExprForLoop`s
Jan 22, 2015
a873316
remove dead code
Jan 22, 2015
9070345
add tests
Jan 23, 2015
ed82b5a
remove Copy impls from iterators
Jan 23, 2015
bfaf422
smoke out remaining bugs
Jan 23, 2015
d4b3e7f
remove the `Iterator` lang item
Jan 23, 2015
cb896a6
fix recursive call
Jan 26, 2015
3a62590
add test for #20605
Jan 26, 2015
c013a01
add test for #21655
Jan 26, 2015
2d76c94
s/while let/for/g now that #21245 has been fixed
Jan 28, 2015
60abb3b
fixes after rebase
Jan 28, 2015
b9a9030
fix some cfail tests
Jan 30, 2015
19a1f7e
Don't use as_slice() in docs
steveklabnik Jan 30, 2015
0cdde6e
std: Stabilize FromStr and parse
alexcrichton Jan 28, 2015
6227357
std: Stabilize the std::fmt module
alexcrichton Jan 13, 2015
0a48818
Fix a missed io => old_io
lukesteensen Jan 30, 2015
341e858
rollup merge of #20790: japaric/for-loops
alexcrichton Jan 30, 2015
15dd0a5
rollup merge of #21385: nick29581/save-fix2
alexcrichton Jan 30, 2015
9ff540b
rollup merge of #21494: jatinn/jsnav
alexcrichton Jan 30, 2015
b446c5b
rollup merge of #21495: richo/unexported-unmangled-lint
alexcrichton Jan 30, 2015
b70ec4d
rollup merge of #21678: vojtechkral/threads-native-names
alexcrichton Jan 30, 2015
16120e9
rollup merge of #21693: tomjakubowski/rustdoc-fix-21442
alexcrichton Jan 30, 2015
103f145
rollup merge of #21702: nikomatsakis/issue-21636
alexcrichton Jan 30, 2015
692a366
rollup merge of #21704: FlaPer87/macro-reexport
alexcrichton Jan 30, 2015
0ba812f
rollup merge of #21706: reem/missing-zeroable-impl-for-unique
alexcrichton Jan 30, 2015
ac1a03d
rollup merge of #21718: alexcrichton/stabilize-from-str
alexcrichton Jan 30, 2015
c0705c1
rollup merge of #21720: huonw/simd-cmp
alexcrichton Jan 30, 2015
f8b3d5c
rollup merge of #21733: mneumann/fix-io-rename-df
alexcrichton Jan 30, 2015
ebee4b4
rollup merge of #21736: sfackler/bufread-capacity-fix
alexcrichton Jan 30, 2015
e2282f9
rollup merge of #21738: steveklabnik/move_out_editors
alexcrichton Jan 30, 2015
c8f2726
rollup merge of #21739: alexcrichton/better-print
alexcrichton Jan 30, 2015
42e4c1a
rollup merge of #21747: nikomatsakis/issue-21726-projection-subtyping
alexcrichton Jan 30, 2015
9d970c6
rollup merge of #21753: dzamlo/master
alexcrichton Jan 30, 2015
62a8462
rollup merge of #21762: brson/users
alexcrichton Jan 30, 2015
6ea5fb8
rollup merge of #21765: P1start/non-ascii-style-lints
alexcrichton Jan 30, 2015
a75e308
rollup merge of #21780: steveklabnik/no_as_slice
alexcrichton Jan 30, 2015
eb3a060
rollup merge of #21783: lukesteensen/patch-1
alexcrichton Jan 30, 2015
8397217
rollup merge of #21760: brson/snaps
alexcrichton Jan 30, 2015
f6dd25b
rollup merge of #21713: alexcrichton/second-pass-fmt
alexcrichton Jan 30, 2015
4c25687
rollup merge of #21528: tshepang/simpler-replace-example
alexcrichton Jan 30, 2015
188d7c0
rollup merge of #21631: tbu-/isize_police
alexcrichton Jan 30, 2015
3a2530d
Test fixes and rebase conflicts
alexcrichton Jan 30, 2015
64dd7be
Merge remote-tracking branch 'origin/master' into rollup
alexcrichton Jan 30, 2015
e8fd9d3
Merge remote-tracking branch 'origin/master' into rollup
alexcrichton Jan 30, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,14 @@ There is a lot more documentation in the [wiki].

The Rust community congregates in a few places:

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

[StackOverflow]: http://stackoverflow.com/questions/tagged/rust
[/r/rust]: http://reddit.com/r/rust
[users.rust-lang.org]: http://users.rust-lang.org/
[internals.rust-lang.org]: http://internals.rust-lang.org/

## License
Expand Down
21 changes: 11 additions & 10 deletions src/compiletest/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@ pub enum Mode {
}

impl FromStr for Mode {
fn from_str(s: &str) -> Option<Mode> {
type Err = ();
fn from_str(s: &str) -> Result<Mode, ()> {
match s {
"compile-fail" => Some(CompileFail),
"run-fail" => Some(RunFail),
"run-pass" => Some(RunPass),
"run-pass-valgrind" => Some(RunPassValgrind),
"pretty" => Some(Pretty),
"debuginfo-lldb" => Some(DebugInfoLldb),
"debuginfo-gdb" => Some(DebugInfoGdb),
"codegen" => Some(Codegen),
_ => None,
"compile-fail" => Ok(CompileFail),
"run-fail" => Ok(RunFail),
"run-pass" => Ok(RunPass),
"run-pass-valgrind" => Ok(RunPassValgrind),
"pretty" => Ok(Pretty),
"debuginfo-lldb" => Ok(DebugInfoLldb),
"debuginfo-gdb" => Ok(DebugInfoGdb),
"codegen" => Ok(Codegen),
_ => Err(()),
}
}
}
Expand Down
22 changes: 9 additions & 13 deletions src/compiletest/compiletest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,20 @@
// except according to those terms.

#![crate_type = "bin"]
#![allow(unknown_features)]
#![feature(slicing_syntax, unboxed_closures)]

#![feature(box_syntax)]
#![feature(collections)]
#![feature(core)]
#![feature(int_uint)]
#![feature(test)]
#![feature(rustc_private)]
#![feature(std_misc)]
#![feature(path)]
#![feature(io)]
#![feature(core)]
#![feature(collections)]
#![feature(os)]
#![feature(path)]
#![feature(rustc_private)]
#![feature(slicing_syntax, unboxed_closures)]
#![feature(std_misc)]
#![feature(test)]
#![feature(unicode)]

#![allow(unstable)]
#![deny(warnings)]

extern crate test;
Expand All @@ -35,7 +34,6 @@ extern crate log;
use std::os;
use std::old_io;
use std::old_io::fs;
use std::str::FromStr;
use std::thunk::Thunk;
use getopts::{optopt, optflag, reqopt};
use common::Config;
Expand Down Expand Up @@ -140,9 +138,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
build_base: opt_path(matches, "build-base"),
aux_base: opt_path(matches, "aux-base"),
stage_id: matches.opt_str("stage-id").unwrap(),
mode: FromStr::from_str(matches.opt_str("mode")
.unwrap()
.as_slice()).expect("invalid mode"),
mode: matches.opt_str("mode").unwrap().parse().ok().expect("invalid mode"),
run_ignored: matches.opt_present("ignored"),
filter: filter,
logfile: matches.opt_str("logfile").map(|s| Path::new(s)),
Expand Down
6 changes: 3 additions & 3 deletions src/compiletest/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ pub fn gdb_version_to_int(version_string: &str) -> int {
panic!("{}", error_string);
}

let major: int = components[0].parse().expect(error_string);
let minor: int = components[1].parse().expect(error_string);
let major: int = components[0].parse().ok().expect(error_string);
let minor: int = components[1].parse().ok().expect(error_string);

return major * 1000 + minor;
}
Expand All @@ -363,6 +363,6 @@ pub fn lldb_version_to_int(version_string: &str) -> int {
"Encountered LLDB version string with unexpected format: {}",
version_string);
let error_string = error_string.as_slice();
let major: int = version_string.parse().expect(error_string);
let major: int = version_string.parse().ok().expect(error_string);
return major;
}
8 changes: 5 additions & 3 deletions src/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ Overflow](http://stackoverflow.com/questions/tagged/rust). Searching for your
problem might reveal someone who has asked it before!

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

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

# Specification

Expand Down
4 changes: 2 additions & 2 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2994,7 +2994,7 @@ Some examples of call expressions:
# fn add(x: i32, y: i32) -> i32 { 0 }
let x: i32 = add(1i32, 2i32);
let pi: Option<f32> = "3.14".parse();
let pi: Option<f32> = "3.14".parse().ok();
```

### Lambda expressions
Expand Down Expand Up @@ -3518,7 +3518,7 @@ An example of each kind:
```{rust}
let vec: Vec<i32> = vec![1, 2, 3];
let arr: [i32; 3] = [1, 2, 3];
let s: &[i32] = vec.as_slice();
let s: &[i32] = &vec;
```

As you can see, the `vec!` macro allows you to create a `Vec<T>` easily. The
Expand Down
24 changes: 13 additions & 11 deletions src/doc/trpl/guessing-game.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ a function for that:
let input = old_io::stdin().read_line()
.ok()
.expect("Failed to read line");
let input_num: Option<u32> = input.parse();
let input_num: Option<u32> = input.parse().ok();
```
The `parse` function takes in a `&str` value and converts it into something.
Expand All @@ -422,11 +422,13 @@ In this case, we say `x` is a `u32` explicitly, so Rust is able to properly
tell `random()` what to generate. In a similar fashion, both of these work:
```{rust,ignore}
let input_num = "5".parse::<u32>(); // input_num: Option<u32>
let input_num: Option<u32> = "5".parse(); // input_num: Option<u32>
let input_num = "5".parse::<u32>().ok(); // input_num: Option<u32>
let input_num: Option<u32> = "5".parse().ok(); // input_num: Option<u32>
```
Anyway, with us now converting our input to a number, our code looks like this:
Here we're converting the `Result` returned by `parse` to an `Option` by using
the `ok` method as well. Anyway, with us now converting our input to a number,
our code looks like this:
```{rust,ignore}
use std::old_io;
Expand All @@ -445,7 +447,7 @@ fn main() {
let input = old_io::stdin().read_line()
.ok()
.expect("Failed to read line");
let input_num: Option<u32> = input.parse();
let input_num: Option<u32> = input.parse().ok();
println!("You guessed: {}", input_num);
Expand Down Expand Up @@ -495,7 +497,7 @@ fn main() {
let input = old_io::stdin().read_line()
.ok()
.expect("Failed to read line");
let input_num: Option<u32> = input.parse();
let input_num: Option<u32> = input.parse().ok();

let num = match input_num {
Some(num) => num,
Expand Down Expand Up @@ -562,7 +564,7 @@ fn main() {
let input = old_io::stdin().read_line()
.ok()
.expect("Failed to read line");
let input_num: Option<u32> = input.trim().parse();
let input_num: Option<u32> = input.trim().parse().ok();

let num = match input_num {
Some(num) => num,
Expand Down Expand Up @@ -638,7 +640,7 @@ fn main() {
let input = old_io::stdin().read_line()
.ok()
.expect("Failed to read line");
let input_num: Option<u32> = input.trim().parse();
let input_num: Option<u32> = input.trim().parse().ok();
let num = match input_num {
Some(num) => num,
Expand Down Expand Up @@ -714,7 +716,7 @@ fn main() {
let input = old_io::stdin().read_line()
.ok()
.expect("Failed to read line");
let input_num: Option<u32> = input.trim().parse();
let input_num: Option<u32> = input.trim().parse().ok();

let num = match input_num {
Some(num) => num,
Expand Down Expand Up @@ -770,7 +772,7 @@ fn main() {
let input = old_io::stdin().read_line()
.ok()
.expect("Failed to read line");
let input_num: Option<u32> = input.trim().parse();
let input_num: Option<u32> = input.trim().parse().ok();

let num = match input_num {
Some(num) => num,
Expand Down Expand Up @@ -847,7 +849,7 @@ fn main() {
let input = old_io::stdin().read_line()
.ok()
.expect("Failed to read line");
let input_num: Option<u32> = input.trim().parse();
let input_num: Option<u32> = input.trim().parse().ok();

let num = match input_num {
Some(num) => num,
Expand Down
4 changes: 2 additions & 2 deletions src/doc/trpl/more-strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ To write a function that's generic over types of strings, use `&str`.

```
fn some_string_length(x: &str) -> uint {
x.len()
x.len()
}
fn main() {
Expand All @@ -110,7 +110,7 @@ fn main() {
let s = "Hello, world".to_string();
println!("{}", some_string_length(s.as_slice()));
println!("{}", some_string_length(&s));
}
```

Expand Down
4 changes: 2 additions & 2 deletions src/doc/trpl/patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,13 @@ match origin {
}
```

If you want to match against a slice or array, you can use `[]`:
If you want to match against a slice or array, you can use `&`:

```{rust}
fn main() {
let v = vec!["match_this", "1"];
match v.as_slice() {
match &v[] {
["match_this", second] => println!("The second element is {}", second),
_ => {},
}
Expand Down
2 changes: 1 addition & 1 deletion src/doc/trpl/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fn expand_rn(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree])
}
};
let mut text = text.as_slice();
let mut text = &text;
let mut total = 0;
while !text.is_empty() {
match NUMERALS.iter().find(|&&(rn, _)| text.starts_with(rn)) {
Expand Down
2 changes: 1 addition & 1 deletion src/doc/trpl/standard-input.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Let's go over these chunks, one by one:
std::old_io::stdin();
```

This calls a function, `stdin()`, that lives inside the `std::io` module. As
This calls a function, `stdin()`, that lives inside the `std::old_io` module. As
you can imagine, everything in `std` is provided by Rust, the 'standard
library.' We'll talk more about the module system later.

Expand Down
26 changes: 3 additions & 23 deletions src/doc/trpl/strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,36 +36,16 @@ s.push_str(", world.");
println!("{}", s);
```

You can get a `&str` view into a `String` with the `as_slice()` method:
`String`s will coerece into `&str` with an `&`:

```{rust}
```
fn takes_slice(slice: &str) {
println!("Got: {}", slice);
}

fn main() {
let s = "Hello".to_string();
takes_slice(s.as_slice());
}
```

To compare a String to a constant string, prefer `as_slice()`...

```{rust}
fn compare(string: String) {
if string.as_slice() == "Hello" {
println!("yes");
}
}
```

... over `to_string()`:

```{rust}
fn compare(string: String) {
if string == "Hello".to_string() {
println!("yes");
}
takes_slice(&s);
}
```

Expand Down
4 changes: 4 additions & 0 deletions src/doc/trpl/unsafe.md
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,10 @@ extern fn panic_fmt(args: &core::fmt::Arguments,
#[lang = "eh_personality"] extern fn eh_personality() {}
# #[start] fn start(argc: isize, argv: *const *const u8) -> isize { 0 }
# fn main() {}
# mod std { // for-loops
# pub use core::iter;
# pub use core::option;
# }
```

Note that there is one extra lang item here which differs from the examples
Expand Down
1 change: 0 additions & 1 deletion src/driver/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![allow(unknown_features)]
#![cfg_attr(rustc, feature(rustc_private))]
#![cfg_attr(rustdoc, feature(rustdoc))]

Expand Down
Loading