Add blanket impls to allow the various `Fn` traits to be interconverted.

Fixes #18387.
Reverse order of lookup
Partial fix for #17901: Be less conservative around unbound type
variables in the intracrate case. This requires a deeper distinction
between inter- and intra-crate so as to keep coherence working.

I suspect the best fix is to generalize the recursion check that
exists today, but this requires a bit more refactoring to achieve.

(In other words, where today it says OK for an exact match, we'd want
to not detect exact matches but rather skolemize each trait-reference
fresh and return AMBIG -- but that requires us to make builtin bounds
work shallowly like everything else and move the cycle detection into
the fulfillment context.)
Correct tests that were supposed to fail but now pass due to the fn trait hierarchy.
auto merge of #18388 : nikomatsakis/rust/fn-trait-hierarchy, r=acrichto

Add blanket impls to allow the various `Fn` traits to be interconverted.

Fixes #18387.
rustc: avoid `use`-ing `syntax::ast::*`.
rustc: middle: rename `ty::t` to `Ty` and use it unqualified everywhere.
rustc: middle: ty: replace unsafe pointers with references in Ty.
rustc: fix fallout of adding the `'tcx` lifetime to `Ty`.
rustc: fix fallout of making `Ty` an alias for `&TyS` instead of a wrapper.
rustc: work around #[deriving(PartialEq)] messing up due to method lookup.
rustc: middle: avoid clones in ty_fn_{sig,args}.
rustc: middle: remove obsolete ty::get.
rustc: remove id's from Ty's in favor of pointer identity.
rustc: middle: simplify primitive type declaration in ty.
rustdoc: fix fallout of ty::t -> Ty<'tcx>.