From 8be9625e2e65df6c7174272f78893394fca209e1 Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Tue, 31 May 2016 17:12:08 -0400 Subject: [PATCH 1/9] document that Files close themselves automatically --- src/libstd/fs.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index 734f774043d6d..fcc84e5484211 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -32,6 +32,9 @@ use time::SystemTime; /// it was opened with. Files also implement `Seek` to alter the logical cursor /// that the file contains internally. /// +/// Files are automatically closed when they go out of scope, so there is no +/// explicit `close` method. +/// /// # Examples /// /// ```no_run From 68ac3e9ff0bf0218b037684812519597afd71a76 Mon Sep 17 00:00:00 2001 From: Matt Kraai Date: Wed, 1 Jun 2016 05:32:11 -0700 Subject: [PATCH 2/9] Fix broken link name in `bool` documentation --- src/libstd/primitive_docs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/primitive_docs.rs b/src/libstd/primitive_docs.rs index e083605a2acd5..11af768c5b9b0 100644 --- a/src/libstd/primitive_docs.rs +++ b/src/libstd/primitive_docs.rs @@ -28,7 +28,7 @@ /// ``` /// /// [`assert!`]: macro.assert!.html -/// [`if` conditionals]: ../book/if.html +/// [`if`]: ../book/if.html /// [`BitAnd`]: ops/trait.BitAnd.html /// [`BitOr`]: ops/trait.BitOr.html /// [`Not`]: ops/trait.Not.html From c34676a7c4df754e15c975bac8659f48f7e64d54 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 1 Jun 2016 16:02:23 +0200 Subject: [PATCH 3/9] Fix E0165 code examples --- src/librustc_const_eval/diagnostics.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/librustc_const_eval/diagnostics.rs b/src/librustc_const_eval/diagnostics.rs index 8b1d7bed7c42d..f2abdf831a3b8 100644 --- a/src/librustc_const_eval/diagnostics.rs +++ b/src/librustc_const_eval/diagnostics.rs @@ -384,18 +384,19 @@ let irr = Irrefutable(0); // This fails to compile because the match is irrefutable. while let Irrefutable(x) = irr { - ... + // ... } +``` Try this instead: -``` +```no_run struct Irrefutable(i32); let irr = Irrefutable(0); loop { let Irrefutable(x) = irr; - ... + // ... } ``` "##, From df8d5baab7b7e9970545419c0e6bf781ea86b12c Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Wed, 1 Jun 2016 10:16:45 -0400 Subject: [PATCH 4/9] allow for the future addition of a close method on File --- src/libstd/fs.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index fcc84e5484211..60c2a516d6a76 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -32,8 +32,7 @@ use time::SystemTime; /// it was opened with. Files also implement `Seek` to alter the logical cursor /// that the file contains internally. /// -/// Files are automatically closed when they go out of scope, so there is no -/// explicit `close` method. +/// Files are automatically closed when they go out of scope. /// /// # Examples /// From d211cd65507ed465a19dc3ae09ecc243960d932d Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 1 Jun 2016 16:17:21 +0200 Subject: [PATCH 5/9] Close unclosed code example in E0185 --- src/librustc_typeck/diagnostics.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index d06030637afd8..e9e52a0121a36 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -2040,6 +2040,7 @@ impl Foo for Bar { // the trait fn foo(&self) {} } +``` "##, E0186: r##" From 2b80753330e58c209581f17208bbb87316a54cdf Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 1 Jun 2016 16:30:13 +0200 Subject: [PATCH 6/9] Add new error code tests --- src/test/compile-fail/E0162.rs | 18 ++++++++++++++++++ src/test/compile-fail/E0163.rs | 20 ++++++++++++++++++++ src/test/compile-fail/E0164.rs | 20 ++++++++++++++++++++ src/test/compile-fail/E0165.rs | 18 ++++++++++++++++++ src/test/compile-fail/E0166.rs | 14 ++++++++++++++ src/test/compile-fail/E0172.rs | 14 ++++++++++++++ src/test/compile-fail/E0178.rs | 21 +++++++++++++++++++++ src/test/compile-fail/E0184.rs | 20 ++++++++++++++++++++ src/test/compile-fail/E0185.rs | 22 ++++++++++++++++++++++ src/test/compile-fail/E0186.rs | 22 ++++++++++++++++++++++ src/test/compile-fail/E0191.rs | 18 ++++++++++++++++++ src/test/compile-fail/E0192.rs | 22 ++++++++++++++++++++++ src/test/compile-fail/E0194.rs | 17 +++++++++++++++++ src/test/compile-fail/E0195.rs | 23 +++++++++++++++++++++++ src/test/compile-fail/E0197.rs | 16 ++++++++++++++++ src/test/compile-fail/E0199.rs | 18 ++++++++++++++++++ src/test/compile-fail/E0200.rs | 18 ++++++++++++++++++ 17 files changed, 321 insertions(+) create mode 100644 src/test/compile-fail/E0162.rs create mode 100644 src/test/compile-fail/E0163.rs create mode 100644 src/test/compile-fail/E0164.rs create mode 100644 src/test/compile-fail/E0165.rs create mode 100644 src/test/compile-fail/E0166.rs create mode 100644 src/test/compile-fail/E0172.rs create mode 100644 src/test/compile-fail/E0178.rs create mode 100644 src/test/compile-fail/E0184.rs create mode 100644 src/test/compile-fail/E0185.rs create mode 100644 src/test/compile-fail/E0186.rs create mode 100644 src/test/compile-fail/E0191.rs create mode 100644 src/test/compile-fail/E0192.rs create mode 100644 src/test/compile-fail/E0194.rs create mode 100644 src/test/compile-fail/E0195.rs create mode 100644 src/test/compile-fail/E0197.rs create mode 100644 src/test/compile-fail/E0199.rs create mode 100644 src/test/compile-fail/E0200.rs diff --git a/src/test/compile-fail/E0162.rs b/src/test/compile-fail/E0162.rs new file mode 100644 index 0000000000000..e13b0af6f7977 --- /dev/null +++ b/src/test/compile-fail/E0162.rs @@ -0,0 +1,18 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Irrefutable(i32); + +fn main() { + let irr = Irrefutable(0); + if let Irrefutable(x) = irr { //~ ERROR E0162 + println!("{}", x); + } +} diff --git a/src/test/compile-fail/E0163.rs b/src/test/compile-fail/E0163.rs new file mode 100644 index 0000000000000..5cb6f4d2803e1 --- /dev/null +++ b/src/test/compile-fail/E0163.rs @@ -0,0 +1,20 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum Foo { B(u32) } + +fn bar(foo: Foo) -> u32 { + match foo { + Foo::B { i } => i, //~ ERROR E0163 + } +} + +fn main() { +} diff --git a/src/test/compile-fail/E0164.rs b/src/test/compile-fail/E0164.rs new file mode 100644 index 0000000000000..491b2e9e5b246 --- /dev/null +++ b/src/test/compile-fail/E0164.rs @@ -0,0 +1,20 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum Foo { B { i: u32 } } + +fn bar(foo: Foo) -> u32 { + match foo { + Foo::B(i) => i, //~ ERROR E0164 + } +} + +fn main() { +} diff --git a/src/test/compile-fail/E0165.rs b/src/test/compile-fail/E0165.rs new file mode 100644 index 0000000000000..cca714bbcc1bf --- /dev/null +++ b/src/test/compile-fail/E0165.rs @@ -0,0 +1,18 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Irrefutable(i32); + +fn main() { + let irr = Irrefutable(0); + while let Irrefutable(x) = irr { //~ ERROR E0165 + // ... + } +} diff --git a/src/test/compile-fail/E0166.rs b/src/test/compile-fail/E0166.rs new file mode 100644 index 0000000000000..9fa41249aa50b --- /dev/null +++ b/src/test/compile-fail/E0166.rs @@ -0,0 +1,14 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn foo() -> ! { return; } //~ ERROR E0166 + +fn main() { +} diff --git a/src/test/compile-fail/E0172.rs b/src/test/compile-fail/E0172.rs new file mode 100644 index 0000000000000..7011bf0e93734 --- /dev/null +++ b/src/test/compile-fail/E0172.rs @@ -0,0 +1,14 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn foo(bar: i32+std::fmt::Display) {} //~ ERROR E0172 + +fn main() { +} diff --git a/src/test/compile-fail/E0178.rs b/src/test/compile-fail/E0178.rs new file mode 100644 index 0000000000000..f34f3834e05b1 --- /dev/null +++ b/src/test/compile-fail/E0178.rs @@ -0,0 +1,21 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Foo {} + +struct Bar<'a> { + w: &'a Foo + Copy, //~ ERROR E0178 + x: &'a Foo + 'a, //~ ERROR E0178 + y: &'a mut Foo + 'a, //~ ERROR E0178 + z: fn() -> Foo + 'a, //~ ERROR E0178 +} + +fn main() { +} diff --git a/src/test/compile-fail/E0184.rs b/src/test/compile-fail/E0184.rs new file mode 100644 index 0000000000000..5d72d00ffe876 --- /dev/null +++ b/src/test/compile-fail/E0184.rs @@ -0,0 +1,20 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#[derive(Copy)] //~ ERROR E0184 +struct Foo; + +impl Drop for Foo { + fn drop(&mut self) { + } +} + +fn main() { +} diff --git a/src/test/compile-fail/E0185.rs b/src/test/compile-fail/E0185.rs new file mode 100644 index 0000000000000..0e33687a84dfb --- /dev/null +++ b/src/test/compile-fail/E0185.rs @@ -0,0 +1,22 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Foo { + fn foo(); +} + +struct Bar; + +impl Foo for Bar { + fn foo(&self) {} //~ ERROR E0185 +} + +fn main() { +} diff --git a/src/test/compile-fail/E0186.rs b/src/test/compile-fail/E0186.rs new file mode 100644 index 0000000000000..aa0a38bedcb54 --- /dev/null +++ b/src/test/compile-fail/E0186.rs @@ -0,0 +1,22 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Foo { + fn foo(&self); +} + +struct Bar; + +impl Foo for Bar { + fn foo() {} //~ ERROR E0186 +} + +fn main() { +} diff --git a/src/test/compile-fail/E0191.rs b/src/test/compile-fail/E0191.rs new file mode 100644 index 0000000000000..489ebb033f84e --- /dev/null +++ b/src/test/compile-fail/E0191.rs @@ -0,0 +1,18 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Trait { + type Bar; +} + +type Foo = Trait; //~ ERROR E0191 + +fn main() { +} diff --git a/src/test/compile-fail/E0192.rs b/src/test/compile-fail/E0192.rs new file mode 100644 index 0000000000000..92f5876ee04d5 --- /dev/null +++ b/src/test/compile-fail/E0192.rs @@ -0,0 +1,22 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(optin_builtin_traits)] + +trait Trait { + type Bar; +} + +struct Foo; + +impl !Trait for Foo { } //~ ERROR E0192 + +fn main() { +} diff --git a/src/test/compile-fail/E0194.rs b/src/test/compile-fail/E0194.rs new file mode 100644 index 0000000000000..96b3062cacb78 --- /dev/null +++ b/src/test/compile-fail/E0194.rs @@ -0,0 +1,17 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Foo { + fn do_something(&self) -> T; + fn do_something_else(&self, bar: T); //~ ERROR E0194 +} + +fn main() { +} diff --git a/src/test/compile-fail/E0195.rs b/src/test/compile-fail/E0195.rs new file mode 100644 index 0000000000000..0630dfea5e64b --- /dev/null +++ b/src/test/compile-fail/E0195.rs @@ -0,0 +1,23 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Trait { + fn bar<'a,'b:'a>(x: &'a str, y: &'b str); +} + +struct Foo; + +impl Trait for Foo { + fn bar<'a,'b>(x: &'a str, y: &'b str) { //~ ERROR E0195 + } +} + +fn main() { +} diff --git a/src/test/compile-fail/E0197.rs b/src/test/compile-fail/E0197.rs new file mode 100644 index 0000000000000..f25fa9b92b9a0 --- /dev/null +++ b/src/test/compile-fail/E0197.rs @@ -0,0 +1,16 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Foo; + +unsafe impl Foo { } //~ ERROR E0197 + +fn main() { +} diff --git a/src/test/compile-fail/E0199.rs b/src/test/compile-fail/E0199.rs new file mode 100644 index 0000000000000..8bd3ffdf6f6ee --- /dev/null +++ b/src/test/compile-fail/E0199.rs @@ -0,0 +1,18 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(optin_builtin_traits)] + +struct Foo; + +unsafe impl !Clone for Foo { } //~ ERROR E0199 + +fn main() { +} diff --git a/src/test/compile-fail/E0200.rs b/src/test/compile-fail/E0200.rs new file mode 100644 index 0000000000000..6bfea0e59d76e --- /dev/null +++ b/src/test/compile-fail/E0200.rs @@ -0,0 +1,18 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Foo; + +unsafe trait Bar { } + +impl Bar for Foo { } //~ ERROR E0200 + +fn main() { +} From 658253d30c124b67c964904400c4dc58a1b557b2 Mon Sep 17 00:00:00 2001 From: Oliver Middleton Date: Wed, 1 Jun 2016 13:32:58 +0100 Subject: [PATCH 7/9] Fix a few links in the book Links to directories and direct links to doc.rust-lang.org don't work properly when viewing the docs offline so fix them. --- src/doc/book/choosing-your-guarantees.md | 2 +- src/doc/book/documentation.md | 2 +- src/doc/book/error-handling.md | 2 +- src/doc/book/using-rust-without-the-standard-library.md | 9 +++++---- src/doc/book/vectors.md | 4 ++-- src/doc/nomicon/README.md | 2 +- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/doc/book/choosing-your-guarantees.md b/src/doc/book/choosing-your-guarantees.md index 50350213074bf..d88f619260ac0 100644 --- a/src/doc/book/choosing-your-guarantees.md +++ b/src/doc/book/choosing-your-guarantees.md @@ -232,7 +232,7 @@ indicator (one word in size) along with the data. At runtime each borrow causes a modification/check of the refcount. -[cell-mod]: ../std/cell/ +[cell-mod]: ../std/cell/index.html [cell]: ../std/cell/struct.Cell.html [refcell]: ../std/cell/struct.RefCell.html diff --git a/src/doc/book/documentation.md b/src/doc/book/documentation.md index 4a41bb7b7f37e..3c6643fbfe155 100644 --- a/src/doc/book/documentation.md +++ b/src/doc/book/documentation.md @@ -76,7 +76,7 @@ This [unfortunate error](https://github.com/rust-lang/rust/issues/22547) is correct; documentation comments apply to the thing after them, and there's nothing after that last comment. -[rc-new]: https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html#method.new +[rc-new]: ../std/rc/struct.Rc.html#method.new ### Writing documentation comments diff --git a/src/doc/book/error-handling.md b/src/doc/book/error-handling.md index c914c33a5a4b9..bca3418706771 100644 --- a/src/doc/book/error-handling.md +++ b/src/doc/book/error-handling.md @@ -2205,7 +2205,7 @@ heuristics! [3]: ../std/option/enum.Option.html#method.unwrap_or [4]: ../std/option/enum.Option.html#method.unwrap_or_else [5]: ../std/option/enum.Option.html -[6]: ../std/result/ +[6]: ../std/result/index.html [7]: ../std/result/enum.Result.html#method.unwrap [8]: ../std/fmt/trait.Debug.html [9]: ../std/primitive.str.html#method.parse diff --git a/src/doc/book/using-rust-without-the-standard-library.md b/src/doc/book/using-rust-without-the-standard-library.md index 1179aebe54c55..69958dd3e68a4 100644 --- a/src/doc/book/using-rust-without-the-standard-library.md +++ b/src/doc/book/using-rust-without-the-standard-library.md @@ -22,11 +22,12 @@ fn plus_one(x: i32) -> i32 { ``` Much of the functionality that’s exposed in the standard library is also -available via the [`core` crate](../core/). When we’re using the standard -library, Rust automatically brings `std` into scope, allowing you to use -its features without an explicit import. By the same token, when using +available via the [`core` crate](../core/index.html). When we’re using the +standard library, Rust automatically brings `std` into scope, allowing you to +use its features without an explicit import. By the same token, when using `#![no_std]`, Rust will bring `core` into scope for you, as well as [its -prelude](../core/prelude/v1/). This means that a lot of code will Just Work: +prelude](../core/prelude/v1/index.html). This means that a lot of code will Just +Work: ```rust #![no_std] diff --git a/src/doc/book/vectors.md b/src/doc/book/vectors.md index 1c44af2f21a71..f3854b8ffddce 100644 --- a/src/doc/book/vectors.md +++ b/src/doc/book/vectors.md @@ -152,5 +152,5 @@ API documentation][vec]. [box]: ../std/boxed/index.html [generic]: generics.html [panic]: concurrency.html#panics -[get]: http://doc.rust-lang.org/std/vec/struct.Vec.html#method.get -[get_mut]: http://doc.rust-lang.org/std/vec/struct.Vec.html#method.get_mut +[get]: ../std/vec/struct.Vec.html#method.get +[get_mut]: ../std/vec/struct.Vec.html#method.get_mut diff --git a/src/doc/nomicon/README.md b/src/doc/nomicon/README.md index 4554652a17a2a..b2e1eac5e0dcc 100644 --- a/src/doc/nomicon/README.md +++ b/src/doc/nomicon/README.md @@ -35,4 +35,4 @@ exception-safety, pointer aliasing, memory models, and even some type-theory. We will also be spending a lot of time talking about the different kinds of safety and guarantees. -[trpl]: ../book/ +[trpl]: ../book/index.html From 1d7f34538d9dd08958671f6606e51a32e237e174 Mon Sep 17 00:00:00 2001 From: kennytm Date: Thu, 2 Jun 2016 00:01:53 +0800 Subject: [PATCH 8/9] Restore original meaning of std::fs::read_dir's example changed in #33958. DirEntry.file_type().is_dir() will not follow symlinks, but the original example (fs::metadata(&path).is_dir()) does. Therefore the change in #33958 introduced a subtle difference that now it won't enter linked folders. To preserve the same behavior, we use Path::is_dir() instead, which does follow symlink. --- src/libstd/fs.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index 734f774043d6d..3c742a9ee56e3 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -1341,8 +1341,9 @@ pub fn remove_dir_all>(path: P) -> io::Result<()> { /// if dir.is_dir() { /// for entry in try!(fs::read_dir(dir)) { /// let entry = try!(entry); -/// if try!(entry.file_type()).is_dir() { -/// try!(visit_dirs(&entry.path(), cb)); +/// let path = entry.path(); +/// if path.is_dir() { +/// try!(visit_dirs(&path, cb)); /// } else { /// cb(&entry); /// } From 920129a258b5ff76e75c8e9c2828e625ae53930d Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Thu, 2 Jun 2016 13:28:24 +0200 Subject: [PATCH 9/9] doc: typo --- src/libstd/process.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/process.rs b/src/libstd/process.rs index 1b6f6c3e875c9..3ce9bcc79f24a 100644 --- a/src/libstd/process.rs +++ b/src/libstd/process.rs @@ -195,7 +195,7 @@ impl FromInner for ChildStderr { /// .arg("-c") /// .arg("echo hello") /// .output() -/// .expect("failed to execute proces"); +/// .expect("failed to execute process"); /// /// let hello = output.stdout; /// ```