Remove {As,Into,To}{Option,Either,Result} traits.

Expanded, that is:

- `AsOption`
- `IntoOption`
- `ToOption`
- `AsEither`
- `IntoEither`
- `ToEither`
- `AsResult`
- `IntoResult`
- `ToResult`

These were defined for each other but never *used* anywhere. They are
all trivial and so removal will have negligible effect upon anyone.
`Either` has fallen out of favour (and its implementation of these
traits of dubious semantics), `Option<T>` → `Result<T, ()>` was never
really useful and `Result<T, E>` → `Option<T>` should now be done with
`Result.ok()` (mirrored with `Result.err()` for even more usefulness).

In summary, there's really no point in any of these remaining.
Rename To{Str,Bytes}Consume traits to Into*.

That is:

- `ToStrConsume` → `IntoStr`;
- `ToBytesConsume` → `IntoBytes`.
Forbid multiple imports in use statements

Closes #10911
Move logic for test output generation forward

By performing this logic very late in the build process, it ended up leading to
bugs like those found in #10973 where certain stages of the build process
expected a particular output format which didn't end up being the case. In order
to fix this, the build output generation is moved very early in the build
process to the absolute first thing in phase 2.

Closes #10973
Remove workarounds from issue #4404

Closes #10875
Check even more live Path nodes in dead-code pass
Fix rustdoc output of enums with private variants

Previously, if every variant was private, it would display as a
variantless enum instead of having the "some variants stripped" comment.
Handle ENOENT

Translate ENOENT to IoErrorKind::FileNotFound.
s/Second borrow/Previous borrow/ in error messages.

When a borrow occurs twice illegally, Rust will label the other borrow
as the "second borrow".  This is quite confusing, as the "second borrow"
usually happened before the flagged borrow (e.g. as far as dataflow
is concerned, the first borrow is OK, the second borrow is illegal.)
This patch renames "second borrow" to "previous borrow", to make the
spatial relationship between the two borrows clearer.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Fix rustdoc HTML rendering

By returning the items to process and storing them in a queue, we were losing
the context that was setup for that item during the recursion. This is an easy
fix, rather than hoisting out the state that it needs.
auto merge of #11030 : cmr/rust/rustdoc_on_fire, r=metajack

By returning the items to process and storing them in a queue, we were losing
the context that was setup for that item during the recursion. This is an easy
fix, rather than hoisting out the state that it needs.
debuginfo: Properly support by-value self arguments
debuginfo: Updated test cases to also test by-value self arguments.
Don't allow impls to force public types

This code in resolve accidentally forced all types with an impl to become
public. This fixes it by default inheriting the privacy of what was previously
there and then becoming `true` if nothing else exits.

Closes #10545
auto merge of #10863 : cadencemarseille/rust/patch-handle-ENOENT, r=alexcrichton

Translate ENOENT to IoErrorKind::FileNotFound.
auto merge of #10979 : alexcrichton/rust/less-bc, r=cmr

By performing this logic very late in the build process, it ended up leading to
bugs like those found in #10973 where certain stages of the build process
expected a particular output format which didn't end up being the case. In order
to fix this, the build output generation is moved very early in the build
process to the absolute first thing in phase 2.

Closes #10973
auto merge of #10967 : chris-morgan/rust/clean-and-tidy-some-traits, r=alexcrichton

### Remove {As,Into,To}{Option,Either,Result} traits.

Expanded, that is:

- `AsOption`
- `IntoOption`
- `ToOption`
- `AsEither`
- `IntoEither`
- `ToEither`
- `AsResult`
- `IntoResult`
- `ToResult`

These were defined for each other but never *used* anywhere. They are
all trivial and so removal will have negligible effect upon anyone.
`Either` has fallen out of favour (and its implementation of these
traits of dubious semantics), `Option<T>` → `Result<T, ()>` was never
really useful and `Result<T, E>` → `Option<T>` should now be done with
`Result.ok()` (mirrored with `Result.err()` for even more usefulness).

In summary, there's really no point in any of these remaining.

### Rename To{Str,Bytes}Consume traits to Into*.

That is:

- `ToStrConsume` → `IntoStr`;
- `ToBytesConsume` → `IntoBytes`.
auto merge of #11009 : ktt3ja/rust/issue-11006, r=alexcrichton

Fix #11006.
llvm: Disable pthread on mingw

llvm supports both win32 native threads and pthread,
but configure tries to find pthread first.
This manually disables pthread to use native api.

This removes libpthreads-2.dll dependency on librustc.
mklldeps.py: Write to file instead of print

It seems that msys automatically converts `\n` to `\r\n` on pipe
redirection, which causes `make tidy` failure.