Modules are either public, or private, so private modules should be stripped out
std: Improve docs for atomics. Fix two bugs

This adds lots of docs to the atomics module. Two of the examples
are using the future atomics API and are ignored temporarily.
I discovered a bug in the way AtomicBool's fetch_nand method is
implemented and fixed it by using the correct value for `true`.
I also fixed the implementation of AcqRel fences (it was only doing
a release barrier), and made a "relaxed" fence a failure.
std: Improve option docs
auto merge of #12954 : brson/rust/atomicdocs, r=alexcrichton

This adds lots of docs to the atomics module. Two of the examples
are using the future atomics API (relying on `Share`) and are ignored temporarily.
I discovered a bug in the way AtomicBool's fetch_nand method is
implemented and fixed it by using the correct value for `true`.
I also fixed the implementation of AcqRel fences (it was only doing
a release barrier), and made a "relaxed" fence a failure.
Docify std::vec_ng

I also removed a couple of methods that were silly and added sort.
Discard MTWT & interner tables from TLD after they stop being useful.
rustc: Fix x86 ffi for struct arguments

This fixes struct passing abi on x86 ffi: Structs are now passed
indirectly with byval attribute (as clang does).
rustc: Fix x86 ffi for empty struct arguments
auto merge of #12955 : sfackler/rust/vec_ng-doc, r=alexcrichton

I also removed a couple of methods that were silly and added sort.
rustc: put ty_trait behind some indirection.

This reduces ty::sty from 160 bytes to just 112, and some measurements
eddyb made suggest that the ty_trait variant occurs very
rarely (e.g. ~1% of all sty instances) hence this will result in a large
memory saving, and the cost of the indirection is unlikely to be an
issue.
rustc: put ty_closure behind some indirection.

This reduces the size of sty from 112 to 96; like with the ty_trait
variant, this variant of sty occurs rarely (~1%) so the benefits are
large and the costs small.
auto merge of #12982 : brson/rust/optiondocs, r=alexcrichton

Various improvements. There's a lot more that can be done.
Remove std::cast::transmute_immut_unsafe

It can be done in safe code using `as *T`.
auto merge of #12762 : klutzy/rust/win-struct-abi, r=alexcrichton

This fixes struct passing abi on x86 ffi: Structs are now passed
indirectly with byval attribute (as clang does).
Empty structs are also explicitly ignored rather than directly passed.

Fixes #5744
Fixes #11198
Fixes #11343
auto merge of #12879 : Aatch/rust/rustdoc-mod-privacy, r=alexcrichton

Modules don't actually inherit privacy, so anything other than Public should be considered private.

Fixes #12801

cc @cmr
rustc: Prevent false positives in crate loading

Previously, any library of the pattern `lib<name>-<hash>-<version>.so` was
>considered a candidate (rightly so) for loading a crate. Sets are generated for
each unique `<hash>`, and then from these sets a candidate is selected. If a set
contained more than one element, then it immediately generated an error saying
that multiple copies of the same dylib were found.

This is incorrect because each candidate needs to be validated to actually
contain a rust library (valid metadata). This commit alters the logic to filter
each set of candidates for a hash to only libraries which are actually rust
libraries. This means that if multiple false positives are found with the right
name pattern, they're all ignored.

Closes #13010
auto merge of #12770 : eddyb/rust/drop-tld, r=cmr

Sadly, this seems to make memory usage worse (unless `Vec<T>` makes it worse and this PR doesn't change that much, which is entirely possible).
Fix spans for enum-struct match arms

Correct spans for fields in enum struct arms where the field and variable are unified
auto merge of #13013 : huonw/rust/tytrait, r=cmr

These variants occur rarely but inflate the whole enum for the other variants, leaving a lot of wasted space. In total this reduces `ty::sty` from 160 bytes to 96 (on a 64-bit platform).

After this, `ty_struct` and `ty_enum` are the largest variants, with the 80-byte `substs` being the major contributor.
std: io: flush stdout on stdin read from tty