vim: Tweak how comment nesting works

Don't try to match line comments inside of a comment block. That makes
no sense and can highlight differently for people who override their
highlights.

Similarly, don't match a doc-comment inside of a comment block. It
shouldn't be highlighted differently unless it's actually a doc-comment
(and nested comments are obviously not doc comments).

Fixes #12307.
Cleaned up trans_fail functions, per eddyb request.
Merge pull request #12308 from kballard/vim-nested-comments

vim: Tweak how comment nesting works

Reviewed-by: brson
Merge pull request #12636 from chromatic/fixup_trans_fail

Cleaned up trans_fail(), per eddyb request.

Reviewed-by: huonw
rustc: Better error when loading invalid libraries

When the metadata format changes, old libraries often cause librustc to abort
when reading their metadata. This should all change with the introduction of SVH
markers, but the loader for crates should gracefully handle libraries without
SVH markers still.

This commit adds support for tripping fewer assertions when loading libraries by
using maybe_get_doc when initially parsing metadata. It's still possible for
some libraries to fall through the cracks, but this should deal with a fairly
large number of them up front.
auto merge of #12645 : alexcrichton/rust/invalid-libraries, r=brson

When the metadata format changes, old libraries often cause librustc to abort
when reading their metadata. This should all change with the introduction of SVH
markers, but the loader for crates should gracefully handle libraries without
SVH markers still.

This commit adds support for tripping fewer assertions when loading libraries by
using maybe_get_doc when initially parsing metadata. It's still possible for
some libraries to fall through the cracks, but this should deal with a fairly
large number of them up front.
auto merge of #12647 : huonw/rust/rustdoc-highlight-macros, r=alexcrichton

Macro definitions are just their raw source code, and so should be
highlighted where possible. Also, $ident non-terminal substitutions are
special, and so are worthy of a little special treatment.
std: Move rand to librand.

This functionality is not super-core and so doesn't need to be included
in std. It's possible that std may need rand (it does a little bit now,
for io::test) in which case the functionality required could be moved to
a secret hidden module and reexposed by librand.

Unfortunately, using #[deprecated] here is hard: there's too much to
mock to make it feasible, since we have to ensure that programs still
typecheck to reach the linting phase.
Remove the dependence of std::io::test on rand.

This replaces it with a manual "task rng" using XorShift and a crappy
seeding mechanism. Theoretically good enough for the purposes
though (unique for tests).
Update users for the std::rand -> librand move.
rand: deprecate `rng`.

This should be called far less than it is because it does expensive OS
interactions and seeding of the internal RNG, `task_rng` amortises this
cost. The main problem is the name is so short and suggestive.

The direct equivalent is `StdRng::new`, which does precisely the same
thing.

The deprecation and descriptive internal failure will make migrating
away from the function easier.