Rewrite method resolution to be cleaner, more correct, and to lay
groundwork for better performance.

Key points:

- Separate out determining which method to use from actually selecting
  a method (this should enable caching, as well as the pcwalton fast-reject strategy).
- Merge the impl selection back into method resolution and don't rely on
  trait matching (this should perform better but also is needed to resolve some
  kind of conflicts, see e.g. `method-two-traits-distinguished-via-where-clause.rs`)
- Purge a lot of out-of-date junk and coercions from method lookups.
Introduce a global counter for inference variables. This *really
helps* for tracing an individual inference variable when debugging.
Substitute type/lifetimeInstatiate method type/early-bound lifetime parameters too when creating xform-self-type.

Fixes #18208.
Unify `replace_late_bound_regions_with_fresh_var` and
`replace_late_bound_regions_with_fresh_reions` into one fn
Various small bits of cleanup.
Tag some code duplication with FIXME for #18741.
Correct error message that changed.
auto merge of #18694 : nikomatsakis/rust/issue-18208-method-dispatch-2, r=nrc

This is a pretty major refactoring of the method dispatch infrastructure. It is intended to avoid gross inefficiencies and enable caching and other optimizations (e.g. #17995), though it itself doesn't seem to execute particularly faster yet. It also solves some cases where we were failing to resolve methods that we theoretically should have succeeded with.

Fixes #18674.

cc #18208