]> git.lizzy.rs Git - rust.git/blob - tests/ui/higher-rank-trait-bounds/issue-100689.rs
Rollup merge of #106797 - FawazTirmizi:dev/issues/104284, r=bjorn3
[rust.git] / tests / ui / higher-rank-trait-bounds / issue-100689.rs
1 // check-pass
2
3 struct Foo<'a> {
4     foo: &'a mut usize,
5 }
6
7 trait Bar<'a> {
8     type FooRef<'b>
9     where
10         'a: 'b;
11     fn uwu(foo: Foo<'a>, f: impl for<'b> FnMut(Self::FooRef<'b>));
12 }
13 impl<'a> Bar<'a> for () {
14     type FooRef<'b>
15     =
16         &'b Foo<'a>
17     where
18         'a : 'b,
19     ;
20
21     fn uwu(
22         foo: Foo<'a>,
23         mut f: impl for<'b> FnMut(&'b Foo<'a>), //relevant part
24     ) {
25         f(&foo);
26     }
27 }
28
29 fn main() {}