sys: reveal std::io representation to sys module

This commit adds a `AsInner` trait to `sys_common` and provides
implementations on many `std::io` types. This is a building block for
exposing platform-specific APIs that hook into `std::io` types.
libs: add std::os::unix module

The new `std::os::unix` module exposes several extension traits
for extracting file descriptors from `std::io` types.
libs: add std::os::windows module

The new `std::os::windows` module exposes several extension traits
for extracting file descriptors, sockets, and handles from `std::io`
types.
Search for implemented kinds recursively on Trait types. Fixes #15155 and #13155.
compiletest: extend syntax with support for choosing same line as previous line.
Add `node_to_user_string`, `node_to_string` variant that drops id from output.
rustdoc: Render associated types on traits and impls
rustdoc: render ast::QPath

Fix #18594
Fixed "::::" appearing in module_path!()
Added test for module_path! fix
Merge libsync into libstd

This patch merges the `libsync` crate into `libstd`, undoing part of the
facade. This is in preparation for ultimately merging `librustrt`, as
well as the upcoming rewrite of `sync`.

Because this removes the `libsync` crate, it is a:

[breaking-change]

However, all uses of `libsync` should be able to reroute through
`std::sync` and `std::comm` instead.
auto merge of #19174 : tomjakubowski/rust/rustdoc-assoc-types, r=alexcrichton

Render associated types on traits and impls, and qualified paths in types.

r? @alexcrichton
Add `LpDowncast`, `LoanPath` variant tracking downcasts in match arms.

`LpDowncast` carries the `DefId` of the variant itself.  To support
this, added the enum variant `DefId` to the `cat_downcast` variant in
`mem_categorization::categorization`.

(updated to fix mem_categorization to handle downcast of enum
struct-variants properly.)
Add `ty` to `LoanPath`.

To make this clean, refactored old `LoanPath` enum into a
`LoanPath` struct with a `ty::t` and a newly-added `LoanPathVariant` enum.

This enabled me to get rid of the ugly and fragile `LoanPath::to_type`
method, and I can probably also get rid of other stuff that was
supporting it, maybe.
`MemCategorizationContext::pat_ty(BindByRef)` yields type of borrowed val now.

This is to fix a problem where I could not reliably map attach the
type for each loan-path to the loan-path itself because the same
loan-path was ending up associated with two different types, because
the cmt's had diverged in their interpretation of the path.
Override `LoanPath` Eq impl to enforce invariant: eq lp's always have eq types.
Track what drop obligations are established on match arms.

This is accomplished by:

1. Add `MatchMode` enum to `expr_use_visitor`.

2. Computing the match mode for each pattern via a pre-pass, and then
   passing the mode along when visiting the pattern in
   expr_use_visitor.

3. Adding a `fn matched_pat` callback to expr_use_visitor, which is
   called on interior struct and enum nodes of the pattern (as opposed
   to `fn consume_pat`, which is only invoked for identifiers at the
   leaves of the pattern), and invoking it accordingly.

Of particular interest are the `cat_downcast` instances established
when matching enum variants.
Check other fields are consistent in `LoanPath::common`.
Added fragments.rs: compute drop obligations remaining post moves.

Includes differentiation between assigned_fragments and
moved_fragments, support for all-but-one array fragments, and
instrumentation to print out the moved/assigned/unmmoved/parents for
each function, factored out into separate submodule.
First tests making use of the new fn move-fragments instrumentation.

The tests use new "//~| ERROR" follow syntax.

Includes a test for moves involving array elements.  It was easier
than i realized to get something naive off the ground here.