]> git.lizzy.rs Git - rust.git/blob - tests/ui/generic-associated-types/issue-101020.rs
Rollup merge of #103702 - WaffleLapkin:lift-sized-bounds-from-pointer-methods-where...
[rust.git] / tests / ui / generic-associated-types / issue-101020.rs
1 pub trait LendingIterator {
2     type Item<'a>
3     where
4         Self: 'a;
5
6     fn consume<F>(self, _f: F)
7     where
8         Self: Sized,
9         for<'a> Self::Item<'a>: FuncInput<'a, Self::Item<'a>>,
10     {
11     }
12 }
13
14 impl<I: LendingIterator + ?Sized> LendingIterator for &mut I {
15     type Item<'a> = I::Item<'a> where Self: 'a;
16 }
17 struct EmptyIter;
18 impl LendingIterator for EmptyIter {
19     type Item<'a> = &'a mut () where Self:'a;
20 }
21 pub trait FuncInput<'a, F>
22 where
23     F: Foo<Self>,
24     Self: Sized,
25 {
26 }
27 impl<'a, T, F: 'a> FuncInput<'a, F> for T where F: Foo<T> {}
28 trait Foo<T> {}
29
30 fn map_test() {
31     (&mut EmptyIter).consume(());
32     //~^ ERROR the trait bound `for<'a> &'a mut (): Foo<&'a mut ()>` is not satisfied
33 }
34
35 fn main() {}