Guide: if
Add os::join_paths, make setenv non-utf8 capable

This commit changes `os` in three ways:

* It adds a `join_paths` function that is the converse to `split_paths`,
  easing manipulation of the `PATH` environment variable according to
  platform conventions.

* **Breaking change**: It changes `split_paths` to no longer drop empty paths, since they are
  meaningful to some shells (where they are synonymous with the current
  working directory).

* It changes `setenv` to take a `BytesContainer` rather than a `&str`
  value, since environment variables may have non-utf8 values on some
  platforms. Since `&str` is a `BytesContainer`, this is *not* a
  breaking change.

Along the way, it also refactors the `split_paths` function so that
`cfg` switches are applied internally (and the function header is given
only once). This fixes a bug: the doc comment had an example for only
one platform.

[breaking-change]
Guide: functions

Just a few words about functions and defining them.
rustc: Remove CrateId and all related support

This commit removes all support in the compiler for the #[crate_id] attribute
and all of its derivative infrastructure. A list of the functionality removed is:

* The #[crate_id] attribute no longer exists
* There is no longer the concept of a version of a crate
* Version numbers are no longer appended to symbol names
* The --crate-id command line option has been removed

To migrate forward, rename #[crate_id] to #[crate_name] and only the name of the
crate itself should be mentioned. The version/path of the old crate id should be
removed.

For a transitionary state, the #[crate_id] attribute is still accepted if
the #[crate_name] is not present, but it is warned about if it is the only
identifier present.

RFC: 0035-remove-crate-id
[breaking-change]
rustc: Add a new codegen flag, -C metadata=foo

This metadata is used to drive the hash of all symbols in a crate. The flag can
be specified a multiple number of times

RFC: 0035-remove-crate-id
rustc: Modify crate loading to ignore versions

This commit modifies crate loading to purely work off a `crate_name` and nothing
else. This commit also changes the patterns recognized from `lib<foo>-*` to
`lib<foo>*` to accomodate the future renamings of output files.

RFC: 0035-remove-crate-id
Add #[crate_name] attributes as necessary
rustc: Stop putting hashes in filenames by default

The compiler will no longer insert a hash or version into a filename by default.
Instead, all output is simply based off the crate name being compiled. For
example, a crate name of `foo` would produce the following outputs:

* bin => foo
* rlib => libfoo.rlib
* dylib => libfoo.{so,dylib} or foo.dll
* staticlib => libfoo.a

The old behavior has been moved behind a new codegen flag,
`-C extra-filename=<hash>`. For example, with the "extra filename" of `bar` and
a crate name of `foo`, the following outputs would be generated:

* bin => foo (same old behavior)
* rlib => libfoobar.rlib
* dylib => libfoobar.{so,dylib} or foobar.dll
* staticlib => libfoobar.a

The makefiles have been altered to pass a hash by default to invocations of
`rustc` so all installed rust libraries will have a hash in their filename. This
is done because the standard libraries are intended to be installed into
privileged directories such as /usr/local. Additionally, it involves very few
build system changes!

RFC: 0035-remove-crate-id
[breaking-change]
rustc: Add a flag for specifying dependencies

This comit implements a new flag, --extern, which is used to specify where a
crate is located. The purpose of this flag is to bypass the normal crate
loading/matching of the compiler to point it directly at the right file.

This flag takes the form `--extern foo=bar` where `foo` is the name of a crate
and `bar` is the location at which to find the crate. Multiple `--extern`
directives are allowed with the same crate name to specify the rlib/dylib pair
for a crate. It is invalid to specify more than one rlib or more than one dylib,
and it's required that the crates are valid rust crates.

I have also added some extensive documentation to metadata::loader about how
crate loading should work.

RFC: 0035-remove-crate-id
test: Fix tests for crate_id removal

This involved removing some tests whose functionality was removed such as many
of the crateresolve tests
rustc: Repurpose the --crate-name CLI flag

In a cargo-driven world the primary location for the name of a crate will be in
its manifest, not in the source file itself. The purpose of this flag is to
reduce required duplication for new cargo projects.

This is a breaking change because the existing --crate-name flag actually
printed the crate name. This flag was renamed to --print-crate-name, and to
maintain consistence, the --crate-file-name flag was renamed to
--print-file-name.

To maintain backwards compatibility, the --crate-file-name flag is still
recognized, but it is deprecated.

[breaking-change]
Test fixes and rebase conflicts
Rationals that have a 1 denom should print like ints
Simplify PatIdent to contain an Ident rather than a Path

Rationale: for what appear to be historical reasons only, the PatIdent contains
a Path rather than an Ident.  This means that there are many places in the code
where an ident is artificially promoted to a path, and---much more problematically---
a bunch of elements from a path are simply thrown away, which seems like an invitation
to some really nasty bugs.

This commit replaces the Path in a PatIdent with a SpannedIdent, which just contains an ident
and a span.
Guide: add mutable binding section

Fixes #15334.
Fix ICE with nested macro_rules!-style macros

Fixes #10536.
remove duplicated slash in install script path
correct a few spelling mistakes in the tutorial
librustc: Have the kind checker check sub-bounds in trait casts.

This can break code that looked like:

    struct S<T> {
        val: T,
    }
    trait Gettable<T> {
        ...
    }
    impl<T: Copy> Gettable<T> for S<T> {
        ...
    }
    let t: Box<S<String>> = box S {
        val: "one".to_string(),
    };
    let a = t as Box<Gettable<String>>;
    //                        ^ note no `Copy` bound

Change this code to:

    impl<T> Gettable<T> for S<T> {
    //   ^ remove `Copy` bound
        ...
    }

Closes #14061.

[breaking-change]
Fix spelling errors.