Fix bug in higher-ranked code that would sometimes leak skolemized regions and/or cause incorrect results.
Cleanup type resolution to use type folding infrastructure and not
have such a silly over-engineered interface.
Delete tests that passed in error. We currently do not support a Clone
impl for fn pointer types including bound regions, unfortunately.
Propagate expected type more widely so that we can rewrite the
issue-14039 test in a more natural way. Previously the "type we will
cast to" was hidden unless it was an integer.
Recycle skolemization counts and add some comments.
Extract skolemize_regions() helper function.
Extract leak check into a distinct subroutine.
Fix a bug in the opt-in-copy work: it was failing to liberate the regions bound in the impl before searching for `Copy` implements for all fields, leading to problems in the "copyability check". Basically the copyability check would wind up looking for an impl of `for<'tcx> Foo<&'tcx T>`. The impl that exists however is `impl<T> Copy for Foo<T>` and the current rules do not consider that a match (something I would like to revise in a later PR).