mk: Ensure docs have relative links to each other

When generating documentation, rustdoc has the ability to generate relative
links within the current distribution of crates to one another. To do this, it
must recognize when a crate's documentation is in the same output directory. The
current threshold for "local documentation for crate X being available" is
whether the directory "doc/X" exists.

This change modifies the build system to have new dependencies for each
directory of upstream crates for a rustdoc invocation. This will ensure that
when building documentation that all the crates in the standard distribution are
guaranteed to have relative links to one another.

This change is prompted by guaranteeing that offline docs always work with one
another. Before this change, races could mean that some docs were built before
others, and hence may have http links when relative links would suffice.

Closes #14747
librustc: Use *signed* extension when converting enums to floats.

Previously, constants used unsigned extension, while non-constants used
signed extension. This unifies both paths to use signed extension.

If this breaks your code, take a deep breath, go for a walk, and
consider why you're relying on the sign extension semantics of
enum-to-float casts.

Closes #8230.

[breaking-change]
rustrt: Fix invalid reads caught by valgrind

This is another case of #13246. The RAII lock wasn't being destroyed until after
the allocation was free'd due to destructor scheduling.

Closes #14784
Add test for issue #13214

Closes #13214
Pub use CheckedDiv in the prelude
Fix deprecated use of ~
Remove outdated info about nested block comments. Fixes #14767
Removed doubled wording.

The guide previously stated:

> The compiler will automatically convert a box box point to a reference like &amp;point.

This fixes the doubled word `box`, so the statement reads

> The compiler will automatically convert a box point to a reference like &amp;point.

The code it is referring to is `compute_distance(&on_the_stack, on_the_heap);`, so a single `box` is appropriate.
Update description to reflect language changes

Previously, the type system's restrictions on borrowing were summarized as

> The previous example showed that the type system forbids any borrowing of owned boxes found in aliasable, mutable memory

This did not jive with the example, which allowed mutations so long as the borrowed reference had been returned. Also, the language has changed to no longer allow aliasable mutable locations. This changes the summary to read

> The previous example showed that the type system forbids mutations of owned boxed values while they are being borrowed. In general, the type system also forbids borrowing a value as mutable if it is already being borrowed - either as a mutable reference or an immutable one.

This adds more general information for the experienced reader as well, to offer a more complete understanding.
sync: Once is no longer unsafe, update docs
Show impl for Ref & RefMut
auto merge of #14777 : alexcrichton/rust/issue-14747, r=huonw

When generating documentation, rustdoc has the ability to generate relative
links within the current distribution of crates to one another. To do this, it
must recognize when a crate's documentation is in the same output directory. The
current threshold for "local documentation for crate X being available" is
whether the directory "doc/X" exists.

This change modifies the build system to have new dependencies for each
directory of upstream crates for a rustdoc invocation. This will ensure that
when building documentation that all the crates in the standard distribution are
guaranteed to have relative links to one another.

This change is prompted by guaranteeing that offline docs always work with one
another. Before this change, races could mean that some docs were built before
others, and hence may have http links when relative links would suffice.

Closes #14747
Fix unclear wording of comment
auto merge of #14786 : pcwalton/rust/enum-to-float-casts, r=alexcrichton

If this breaks your code, take a deep breath, go for a walk, and
consider why you're relying on the sign extension semantics of
enum-to-float casts.

[breaking-change]

Closes #8230.
auto merge of #14787 : alexcrichton/rust/issue-14784, r=pcwalton

This is another case of #13246. The RAII lock wasn't being destroyed until after
the allocation was free'd due to destructor scheduling.

Closes #14784
auto merge of #14788 : Sawyer47/rust/issue-13214, r=huonw

Closes #13214
auto merge of #14789 : aochagavia/rust/prelude, r=alexcrichton
rustc: Update how Gc<T> is recognized

This commit uses the same trick as ~/Box to map Gc<T> to @T internally inside
the compiler. This moves a number of implementations of traits to the `gc`
module in the standard library.

This removes functions such as `Gc::new`, `Gc::borrow`, and `Gc::ptr_eq` in
favor of the more modern equivalents, `box(GC)`, `Deref`, and pointer equality.

The Gc pointer itself should be much more useful now, and subsequent commits
will move the compiler away from @T towards Gc<T>

[breaking-change]
syntax: Move the AST from @T to Gc<T>
rustc: Move the AST from @T to Gc<T>