Skip to content

Commit b47a442

Browse files
committed
Auto merge of #34034 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 7 pull requests - Successful merges: #33993, #34013, #34014, #34015, #34019, #34021, #34033 - Failed merges:
2 parents 270bd7c + 7399403 commit b47a442

28 files changed

+344
-17
lines changed

src/doc/book/choosing-your-guarantees.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ indicator (one word in size) along with the data.
232232

233233
At runtime each borrow causes a modification/check of the refcount.
234234

235-
[cell-mod]: ../std/cell/
235+
[cell-mod]: ../std/cell/index.html
236236
[cell]: ../std/cell/struct.Cell.html
237237
[refcell]: ../std/cell/struct.RefCell.html
238238

src/doc/book/documentation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ This [unfortunate error](https://github.com/rust-lang/rust/issues/22547) is
7676
correct; documentation comments apply to the thing after them, and there's
7777
nothing after that last comment.
7878

79-
[rc-new]: https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html#method.new
79+
[rc-new]: ../std/rc/struct.Rc.html#method.new
8080

8181
### Writing documentation comments
8282

src/doc/book/error-handling.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2205,7 +2205,7 @@ heuristics!
22052205
[3]: ../std/option/enum.Option.html#method.unwrap_or
22062206
[4]: ../std/option/enum.Option.html#method.unwrap_or_else
22072207
[5]: ../std/option/enum.Option.html
2208-
[6]: ../std/result/
2208+
[6]: ../std/result/index.html
22092209
[7]: ../std/result/enum.Result.html#method.unwrap
22102210
[8]: ../std/fmt/trait.Debug.html
22112211
[9]: ../std/primitive.str.html#method.parse

src/doc/book/using-rust-without-the-standard-library.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ fn plus_one(x: i32) -> i32 {
2222
```
2323

2424
Much of the functionality that’s exposed in the standard library is also
25-
available via the [`core` crate](../core/). When we’re using the standard
26-
library, Rust automatically brings `std` into scope, allowing you to use
27-
its features without an explicit import. By the same token, when using
25+
available via the [`core` crate](../core/index.html). When we’re using the
26+
standard library, Rust automatically brings `std` into scope, allowing you to
27+
use its features without an explicit import. By the same token, when using
2828
`#![no_std]`, Rust will bring `core` into scope for you, as well as [its
29-
prelude](../core/prelude/v1/). This means that a lot of code will Just Work:
29+
prelude](../core/prelude/v1/index.html). This means that a lot of code will Just
30+
Work:
3031

3132
```rust
3233
#![no_std]

src/doc/book/vectors.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,5 +152,5 @@ API documentation][vec].
152152
[box]: ../std/boxed/index.html
153153
[generic]: generics.html
154154
[panic]: concurrency.html#panics
155-
[get]: http://doc.rust-lang.org/std/vec/struct.Vec.html#method.get
156-
[get_mut]: http://doc.rust-lang.org/std/vec/struct.Vec.html#method.get_mut
155+
[get]: ../std/vec/struct.Vec.html#method.get
156+
[get_mut]: ../std/vec/struct.Vec.html#method.get_mut

src/doc/nomicon/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ exception-safety, pointer aliasing, memory models, and even some type-theory.
3535
We will also be spending a lot of time talking about the different kinds
3636
of safety and guarantees.
3737

38-
[trpl]: ../book/
38+
[trpl]: ../book/index.html

src/librustc_const_eval/diagnostics.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -384,18 +384,19 @@ let irr = Irrefutable(0);
384384
385385
// This fails to compile because the match is irrefutable.
386386
while let Irrefutable(x) = irr {
387-
...
387+
// ...
388388
}
389+
```
389390
390391
Try this instead:
391392
392-
```
393+
```no_run
393394
struct Irrefutable(i32);
394395
let irr = Irrefutable(0);
395396
396397
loop {
397398
let Irrefutable(x) = irr;
398-
...
399+
// ...
399400
}
400401
```
401402
"##,

src/librustc_typeck/diagnostics.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2040,6 +2040,7 @@ impl Foo for Bar {
20402040
// the trait
20412041
fn foo(&self) {}
20422042
}
2043+
```
20432044
"##,
20442045

20452046
E0186: r##"

src/libstd/fs.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ use time::SystemTime;
3232
/// it was opened with. Files also implement `Seek` to alter the logical cursor
3333
/// that the file contains internally.
3434
///
35+
/// Files are automatically closed when they go out of scope.
36+
///
3537
/// # Examples
3638
///
3739
/// ```no_run
@@ -1341,8 +1343,9 @@ pub fn remove_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
13411343
/// if dir.is_dir() {
13421344
/// for entry in try!(fs::read_dir(dir)) {
13431345
/// let entry = try!(entry);
1344-
/// if try!(entry.file_type()).is_dir() {
1345-
/// try!(visit_dirs(&entry.path(), cb));
1346+
/// let path = entry.path();
1347+
/// if path.is_dir() {
1348+
/// try!(visit_dirs(&path, cb));
13461349
/// } else {
13471350
/// cb(&entry);
13481351
/// }

src/libstd/primitive_docs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/// ```
2929
///
3030
/// [`assert!`]: macro.assert!.html
31-
/// [`if` conditionals]: ../book/if.html
31+
/// [`if`]: ../book/if.html
3232
/// [`BitAnd`]: ops/trait.BitAnd.html
3333
/// [`BitOr`]: ops/trait.BitOr.html
3434
/// [`Not`]: ops/trait.Not.html

src/libstd/process.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ impl FromInner<AnonPipe> for ChildStderr {
195195
/// .arg("-c")
196196
/// .arg("echo hello")
197197
/// .output()
198-
/// .expect("failed to execute proces");
198+
/// .expect("failed to execute process");
199199
///
200200
/// let hello = output.stdout;
201201
/// ```

src/test/compile-fail/E0162.rs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
struct Irrefutable(i32);
12+
13+
fn main() {
14+
let irr = Irrefutable(0);
15+
if let Irrefutable(x) = irr { //~ ERROR E0162
16+
println!("{}", x);
17+
}
18+
}

src/test/compile-fail/E0163.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
enum Foo { B(u32) }
12+
13+
fn bar(foo: Foo) -> u32 {
14+
match foo {
15+
Foo::B { i } => i, //~ ERROR E0163
16+
}
17+
}
18+
19+
fn main() {
20+
}

src/test/compile-fail/E0164.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
enum Foo { B { i: u32 } }
12+
13+
fn bar(foo: Foo) -> u32 {
14+
match foo {
15+
Foo::B(i) => i, //~ ERROR E0164
16+
}
17+
}
18+
19+
fn main() {
20+
}

src/test/compile-fail/E0165.rs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
struct Irrefutable(i32);
12+
13+
fn main() {
14+
let irr = Irrefutable(0);
15+
while let Irrefutable(x) = irr { //~ ERROR E0165
16+
// ...
17+
}
18+
}

src/test/compile-fail/E0166.rs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
fn foo() -> ! { return; } //~ ERROR E0166
12+
13+
fn main() {
14+
}

src/test/compile-fail/E0172.rs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
fn foo(bar: i32+std::fmt::Display) {} //~ ERROR E0172
12+
13+
fn main() {
14+
}

src/test/compile-fail/E0178.rs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
trait Foo {}
12+
13+
struct Bar<'a> {
14+
w: &'a Foo + Copy, //~ ERROR E0178
15+
x: &'a Foo + 'a, //~ ERROR E0178
16+
y: &'a mut Foo + 'a, //~ ERROR E0178
17+
z: fn() -> Foo + 'a, //~ ERROR E0178
18+
}
19+
20+
fn main() {
21+
}

src/test/compile-fail/E0184.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#[derive(Copy)] //~ ERROR E0184
12+
struct Foo;
13+
14+
impl Drop for Foo {
15+
fn drop(&mut self) {
16+
}
17+
}
18+
19+
fn main() {
20+
}

src/test/compile-fail/E0185.rs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
trait Foo {
12+
fn foo();
13+
}
14+
15+
struct Bar;
16+
17+
impl Foo for Bar {
18+
fn foo(&self) {} //~ ERROR E0185
19+
}
20+
21+
fn main() {
22+
}

src/test/compile-fail/E0186.rs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
trait Foo {
12+
fn foo(&self);
13+
}
14+
15+
struct Bar;
16+
17+
impl Foo for Bar {
18+
fn foo() {} //~ ERROR E0186
19+
}
20+
21+
fn main() {
22+
}

src/test/compile-fail/E0191.rs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
trait Trait {
12+
type Bar;
13+
}
14+
15+
type Foo = Trait; //~ ERROR E0191
16+
17+
fn main() {
18+
}

src/test/compile-fail/E0192.rs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![feature(optin_builtin_traits)]
12+
13+
trait Trait {
14+
type Bar;
15+
}
16+
17+
struct Foo;
18+
19+
impl !Trait for Foo { } //~ ERROR E0192
20+
21+
fn main() {
22+
}

src/test/compile-fail/E0194.rs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
trait Foo<T> {
12+
fn do_something(&self) -> T;
13+
fn do_something_else<T: Clone>(&self, bar: T); //~ ERROR E0194
14+
}
15+
16+
fn main() {
17+
}

0 commit comments

Comments
 (0)