Typeck: Disallow scalar casts to bare_fn.

Bare functions are another example of a scalar but non-numeric
type (like char) that should be handled separately in casts.
This disallows expressions like `0 as extern "Rust" fn() -> int;`.

It might be advantageous to allow casts between bare functions
and raw pointers in unsafe code in the future, to pass function
pointers between Rust and C.

Closes #8728
Create epub versions of tutorial and ref manual.

Pandoc can create epub verions of the markdown files. Since the docs
are lengthy, epubs are handy to have around. Two rules to create epub
versions of the reference manual and the main tutorial are added here.

Signed-off-by: Noufal Ibrahim <noufal@nibrahim.net.in>
Add default 'package_id' link meta for crates (with value equal to 'name')
Added default value for package_id attribute when encoding metadata for lib crates
Added tests for default generation of package_id meta attribute
Specify package_id for rust libs, to avoid spurious warnings
Create a new pass to resolve named lifetimes; rscope is not only
used to indicate when anonymous regions (i.e., &T) are permitted
Added a FIXME with issue number to change package_id
Introduce ty_fold mechanism and port our various folders to use
it. This should eventually be merged with the Subst trait.
Implement IterBytes for TypeId
rustpkg: Add a test that `rustpkg install` doesn't copy a non-changed file

This bug was already fixed, just needed a test.

Closes #9569
extra / rustpkg: Make getopts::opt_val private again

and use opt_str instead of opt_val in rustpkg

Closes #9311
Generalize AST and ty::Generics to accept multiple lifetimes.
Introduce new variance inference pass that replaces (and generalizes) old
region-parameterization/variance inference. We now compute variance for
type parameters but do not make use of it (most of the way towards #3598).
Move comparing of impl methods against trait from collect to check.
This code fits better in check because it is checking that the impl
matches the interface. This allows us to avoid the awkward constructions
that lazilly collect traits and so forth. It also permits us to make
use of the results of variance inference.
Improve error reporting for region inference failures to make use of
all the information it has at its disposal. Unfortunately this also
reveals that we need to improve the reporting heuristics further,
as sometimes the errors it chooses to emit seem somewhat mystifying
and are not related to the actual problem.
Update various tests and libraries that were incorrectly
annotated.
Rename and modernize region enum names
Update FIXMEs with issue numbers
Address comments from @pnkfelix (thanks for the detailed review)