Generalize object and type parameter bounds

An RFC summarizing type system changes that close up rust-lang/rust#5723 and related bugs.
On Thu, Aug 07, 2014 at 12:53:14AM -0700, Nick Cameron wrote:
> Given that internally the compiler will handle multiple bounds and
> the syntax must allow for multiple bounds (one lifetime and multiple
> trait), this restriction seems artificial and not really a
> simplification at all (in the sense that you are adding a case to a
> rule).

In the case of parameter types, the restriction is artificial, I
agree. I was also pondering removing it, particularly since -- as you
point out -- inference may infer multiple bounds, so clearly we are
already handling this case.

In the case of *object types*, however, the story is different, and
there I strongly wish to retain a single "master" bound. the
motivation is that handling multiple bounds was overwhelmingly
complicated to reason about and implement, and I would not want to
remove that. The problem is that in various places you wind up with
constraints of the form `all i. exists j. R[i] <= R[j]`, where `R` is
a list of regions. This is very challenging for region inference,
since there are many options for it to choose from, and thus inference
is no longer a fixed-point iteration. Moreover, it doesn't seem to add
any particular expressiveness.

The places where this becomes important are:

- Checking region bounds when data is closed over into an object type
- Subtyping between object types, which would most naturally be
  contravariant in the region bound

I will add a note to this effect to the RFC.