When going through the docs, it is not clear that binary files cannot be tested. Additionally, it is hard to find the proper structure of a Rust crate and it took me several hours of looking through the docs to find the crates and modules section. I think we can link to it from here and it will be beneficial to those who are coming to the language.
This commit adds `#[derive(Clone)]` to `std::fs::Metadata`, making that struct cloneable. Although the exact contents of that struct differ between OSes, they all have it contain only value types, meaning that the data can be re-used without repercussions.
It also adds `#[derive(Clone)]` to every type used by that struct across all OSes, including the various Unix `stat` structs and Windows's `WIN32_FILE_ATTRIBUTE_DATA`.
This stems from my comment here: https://github.com/rust-lang/rfcs/issues/939#issuecomment-140524439
Regarding [#29063 _[Docs] Terminology inconsistency between 'iterator adapters' and 'iterator adaptors'_](https://github.com/rust-lang/rust/issues/29063) :
This PR replaces 'iterator adapters' appearances (in TRPL book) to 'iterator adaptors', thus embracing the terminology used along the API docs and achieving consistency between both sources.
Before this commit, the first "A Rust library" code sample produced
the following compilation warning:
```
test.rs:7:22: 7:36 warning: unnecessary parentheses around `for` head
expression, #[warn(unused_parens)] on by default
test.rs:7 for _ in (0..5_000_000) {
```
This commit just removes the parens around the range 0..5_000_000 thereby removing the compilation warning.
Fixes#28676.
There doesn't seem to be a good way to add a test for this, but I tested the repro in #28676 and confirmed it now yields the correct result.
Regarding #29063: Replace 'iterator adapters' appearances to
'iterator adaptors', thus embracing the terminology used along the
API docs and achieving consistency between both sources.
Before this commit, the first "A Rust library" code sample produced
the following compilation warning:
```
test.rs:7:22: 7:36 warning: unnecessary parentheses around `for` head
expression, #[warn(unused_parens)] on by default
test.rs:7 for _ in (0..5_000_000) {
```
This commit just removes the parens around the range 0..5_000_000.
This is needed as item types are allowed to be unnormalized.
Fixes an ICE that occurs when foreign function signatures contained
an associated type.
Fixes#28983
r? @steveklabnik
The link is broken here: <https://doc.rust-lang.org/std/io/#types>.
Looks like crate documentation generator uses only first paragraph of the module documentation and
so doesn't resolve the link defined below.
Probably this behaviour of the documentation generator should be considered as a bug and should be reported.
This rather crucial requirement was not checked. In most cases, that
didn't cause any trouble because the argument types are required to
outlive the call and are subtypes of a subformula of the callee type.
However, binary ops are taken by ref only indirectly, without it being
marked in the argument types, which led to the argument types not being
constrained anywhere causing spurious errors (as these are basically
unconstrainable, I don't think this change can break code). Of course,
the old way was also incorrent with contravariance, but that is still
unsound for other reasons.
This also improves rustc::front to get RUST_LOG to *somewhat* work.
Fixes#28999. That issue is one of the several regression introduced by #28669.
r? @pnkfelix