1 #![feature(generic_associated_types)]
3 pub trait LendingIterator {
8 fn consume<F>(self, _f: F)
11 for<'a> Self::Item<'a>: FuncInput<'a, Self::Item<'a>>,
16 impl<I: LendingIterator + ?Sized> LendingIterator for &mut I {
17 type Item<'a> = I::Item<'a> where Self: 'a;
20 impl LendingIterator for EmptyIter {
21 type Item<'a> = &'a mut () where Self:'a;
23 pub trait FuncInput<'a, F>
29 impl<'a, T, F: 'a> FuncInput<'a, F> for T where F: Foo<T> {}
33 (&mut EmptyIter).consume(());
34 //~^ ERROR the trait bound `for<'a> &'a mut (): Foo<&'a mut ()>` is not satisfied