Higher-ranked trait bounds

A description of higher-ranked trait bounds, which is the remaining piece needed to make unboxed closures equal to normal closures.

[Rendered view.](https://github.com/nikomatsakis/rfcs/blob/hrtb/active/0000-higher-ranked-trait-bounds.md)


On Fri, Oct 10, 2014 at 02:06:51PM -0700, P1start wrote:
> The current syntax for higher-ranked lifetimes in bare functions is `fn<'a>(&'a int)`, not `<'a> fn(&'a int)`. Perhaps bare functions could stay the same, `Fn{,Mut,Once}` could use a similar syntax with the sugar (`Fn<'a>(&'a int)`), and any other trait would have to use the `for` syntax (`for<'a> Foo<&'a int>`).

I considered this. The main reason I did not propose it is that it
makes the parsing much more subtle. How do I know whether `Foo<` is
going to be `Foo<A,B>` or `Foo<'a>(...)`? It seems to require quite a
bit of lookahead, particularly if you don't want to rely on the
lifetime vs type distinction (which I don't, for reasons described in
the RFC). I suppose that there *is* a cover grammar, nonetheless, so
in principle it doesn't require extraordinary lookahead.

Of course, there is also some appeal to having a single syntax that is
uniformly applicable to all types.

In any case I certainly ought to have included a section on it for the
RFC.