#![feature(generic_associated_types)]
+use std::ops::Deref;
+
//FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
//follow-up PR
type Iter<'a>: Iterator<Item = Self::Item<'a>>;
//~^ ERROR lifetime parameters are not allowed on this type [E0110]
+ // This weird type tests that we can use universal function call syntax to access the Item on
+ // Self::Iter which we have declared to be an Iterator
+ type Iter2<'a>: Deref<Target = <Self::Iter<'a> as Iterator>::Item>;
+ //~^ ERROR lifetime parameters are not allowed on this type [E0110]
+
fn iter<'a>(&'a self) -> Self::Iter<'a>;
//~^ ERROR lifetime parameters are not allowed on this type [E0110]
}
error[E0110]: lifetime parameters are not allowed on this type
- --> $DIR/iterable.rs:18:47
+ --> $DIR/iterable.rs:20:47
|
-18 | type Iter<'a>: Iterator<Item = Self::Item<'a>>;
+20 | type Iter<'a>: Iterator<Item = Self::Item<'a>>;
| ^^ lifetime parameter not allowed on this type
error[E0110]: lifetime parameters are not allowed on this type
- --> $DIR/iterable.rs:21:41
+ --> $DIR/iterable.rs:25:48
|
-21 | fn iter<'a>(&'a self) -> Self::Iter<'a>;
+25 | type Iter2<'a>: Deref<Target = <Self::Iter<'a> as Iterator>::Item>;
+ | ^^ lifetime parameter not allowed on this type
+
+error[E0110]: lifetime parameters are not allowed on this type
+ --> $DIR/iterable.rs:28:41
+ |
+28 | fn iter<'a>(&'a self) -> Self::Iter<'a>;
| ^^ lifetime parameter not allowed on this type
-error: aborting due to 2 previous errors
+error: aborting due to 3 previous errors