Can't compile type with lifetime bound in certain order (original) (raw)

This compiles:

fn lol<'a>() -> Box<Iterator<Item=()> + 'a> { unimplemented!() }

fn main() { }

This doesn't:

fn lol<'a>() -> Box<Iterator<'a + Item=()>> { unimplemented!() }

fn main() { }

Error:

rustc 1.16.0-nightly (1a2ed98d3 2017-01-13)
error: expected `,` or `>` after lifetime name, found `+`
 --> <anon>:1:24
  |
1 | fn lol<'a>() -> Box<'a + Iterator<Item=()>> {
  |                        ^
  |
note: did you mean a single argument type &'a Type, or did you mean the comma-separated arguments 'a, Type?
 --> <anon>:1:21
  |
1 | fn lol<'a>() -> Box<'a + Iterator<Item=()>> {
  |                     ^^^^

error: aborting due to previous error