Add tests for sub relationship on free/bound regions, revealing a bug.
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).
Create distinct types for a PolyTraitRef (with bindings) and a normal TraitRef.
Rename the code that replaces unbound variables to "freshen" rather than "skolemize" -- strictly speaking, this is not skolemization, because it is not discharging quantifiers. Also, the trait selection code will still be doing true skolemization, so it would be a confusing overlap of names.
Add (currently unused) helper routine for skolemizing bound regions.
Centralize on using `Binder` to introduce new binding levels, rather than having FnSig carry an implicit binding level.  This means that we be more typesafe in general, since things that instantiate bound regions can drop the Binder to reflect that.
Move `leak_check` into its own method, and ensure that all higher-ranked code is in
`higher_ranked.rs`.
Make all predicates higher-ranked, not just trait references.
Implement "perfect forwarding" for HR impls (#19730).
Convert gigantic comment away from `//!` form. It is annoying to
read (`//!` is intrusive) and annoying to edit (must maintain a prefix
on every line). Since the only purpose of a `doc.rs` file is to have a
bunch of text, using `/*!` and `*/` without indentations seems
appropriate.
Remove text on method matching, which is now out of date.
Document new algorithm at a high-level.
Work around #19982 by rewriting test impls to not use anonymous
lifetimes. This currently causes an ICE; it should (ideally) work, but
failing that at least give a structured error. For the purposes of
this PR, though, workaround is fine.