1 error[E0631]: type mismatch in closure arguments
2 --> $DIR/anonymous-higher-ranked-lifetime.rs:2:5
4 LL | f1(|_: (), _: ()| {});
5 | ^^ -------------- found signature defined here
9 = note: expected closure signature `for<'a, 'b> fn(&'a (), &'b ()) -> _`
10 found closure signature `fn((), ()) -> _`
11 note: required by a bound in `f1`
12 --> $DIR/anonymous-higher-ranked-lifetime.rs:16:25
14 LL | fn f1<F>(_: F) where F: Fn(&(), &()) {}
15 | ^^^^^^^^^^^^ required by this bound in `f1`
16 help: consider borrowing the argument
18 LL | f1(|_: &(), _: &()| {});
21 error[E0631]: type mismatch in closure arguments
22 --> $DIR/anonymous-higher-ranked-lifetime.rs:3:5
24 LL | f2(|_: (), _: ()| {});
25 | ^^ -------------- found signature defined here
27 | expected due to this
29 = note: expected closure signature `for<'a, 'b> fn(&'a (), &'b ()) -> _`
30 found closure signature `fn((), ()) -> _`
31 note: required by a bound in `f2`
32 --> $DIR/anonymous-higher-ranked-lifetime.rs:17:25
34 LL | fn f2<F>(_: F) where F: for<'a> Fn(&'a (), &()) {}
35 | ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `f2`
36 help: consider borrowing the argument
38 LL | f2(|_: &'a (), _: &()| {});
41 error[E0631]: type mismatch in closure arguments
42 --> $DIR/anonymous-higher-ranked-lifetime.rs:4:5
44 LL | f3(|_: (), _: ()| {});
45 | ^^ -------------- found signature defined here
47 | expected due to this
49 = note: expected closure signature `for<'a> fn(&(), &'a ()) -> _`
50 found closure signature `fn((), ()) -> _`
51 note: required by a bound in `f3`
52 --> $DIR/anonymous-higher-ranked-lifetime.rs:18:29
54 LL | fn f3<'a, F>(_: F) where F: Fn(&'a (), &()) {}
55 | ^^^^^^^^^^^^^^^ required by this bound in `f3`
56 help: consider borrowing the argument
58 LL | f3(|_: &(), _: &()| {});
61 error[E0631]: type mismatch in closure arguments
62 --> $DIR/anonymous-higher-ranked-lifetime.rs:5:5
64 LL | f4(|_: (), _: ()| {});
65 | ^^ -------------- found signature defined here
67 | expected due to this
69 = note: expected closure signature `for<'r, 'a> fn(&'a (), &'r ()) -> _`
70 found closure signature `fn((), ()) -> _`
71 note: required by a bound in `f4`
72 --> $DIR/anonymous-higher-ranked-lifetime.rs:19:25
74 LL | fn f4<F>(_: F) where F: for<'r> Fn(&(), &'r ()) {}
75 | ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `f4`
76 help: consider borrowing the argument
78 LL | f4(|_: &(), _: &'r ()| {});
81 error[E0631]: type mismatch in closure arguments
82 --> $DIR/anonymous-higher-ranked-lifetime.rs:6:5
84 LL | f5(|_: (), _: ()| {});
85 | ^^ -------------- found signature defined here
87 | expected due to this
89 = note: expected closure signature `for<'r> fn(&'r (), &'r ()) -> _`
90 found closure signature `fn((), ()) -> _`
91 note: required by a bound in `f5`
92 --> $DIR/anonymous-higher-ranked-lifetime.rs:20:25
94 LL | fn f5<F>(_: F) where F: for<'r> Fn(&'r (), &'r ()) {}
95 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `f5`
96 help: consider borrowing the argument
98 LL | f5(|_: &'r (), _: &'r ()| {});
101 error[E0631]: type mismatch in closure arguments
102 --> $DIR/anonymous-higher-ranked-lifetime.rs:7:5
104 LL | g1(|_: (), _: ()| {});
107 | | | help: consider borrowing the argument: `&()`
108 | | found signature defined here
109 | expected due to this
111 = note: expected closure signature `for<'a> fn(&'a (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>) -> _`
112 found closure signature `fn((), ()) -> _`
113 note: required by a bound in `g1`
114 --> $DIR/anonymous-higher-ranked-lifetime.rs:23:25
116 LL | fn g1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>) {}
117 | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g1`
119 error[E0631]: type mismatch in closure arguments
120 --> $DIR/anonymous-higher-ranked-lifetime.rs:8:5
122 LL | g2(|_: (), _: ()| {});
125 | | | help: consider borrowing the argument: `&()`
126 | | found signature defined here
127 | expected due to this
129 = note: expected closure signature `for<'a> fn(&'a (), for<'a> fn(&'a ())) -> _`
130 found closure signature `fn((), ()) -> _`
131 note: required by a bound in `g2`
132 --> $DIR/anonymous-higher-ranked-lifetime.rs:24:25
134 LL | fn g2<F>(_: F) where F: Fn(&(), fn(&())) {}
135 | ^^^^^^^^^^^^^^^^ required by this bound in `g2`
137 error[E0631]: type mismatch in closure arguments
138 --> $DIR/anonymous-higher-ranked-lifetime.rs:9:5
140 LL | g3(|_: (), _: ()| {});
143 | | | help: consider borrowing the argument: `&'s ()`
144 | | found signature defined here
145 | expected due to this
147 = note: expected closure signature `for<'s> fn(&'s (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>) -> _`
148 found closure signature `fn((), ()) -> _`
149 note: required by a bound in `g3`
150 --> $DIR/anonymous-higher-ranked-lifetime.rs:25:25
152 LL | fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<dyn Fn(&())>) {}
153 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g3`
155 error[E0631]: type mismatch in closure arguments
156 --> $DIR/anonymous-higher-ranked-lifetime.rs:10:5
158 LL | g4(|_: (), _: ()| {});
161 | | | help: consider borrowing the argument: `&()`
162 | | found signature defined here
163 | expected due to this
165 = note: expected closure signature `for<'a> fn(&'a (), for<'r> fn(&'r ())) -> _`
166 found closure signature `fn((), ()) -> _`
167 note: required by a bound in `g4`
168 --> $DIR/anonymous-higher-ranked-lifetime.rs:26:25
170 LL | fn g4<F>(_: F) where F: Fn(&(), for<'r> fn(&'r ())) {}
171 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g4`
173 error[E0631]: type mismatch in closure arguments
174 --> $DIR/anonymous-higher-ranked-lifetime.rs:11:5
176 LL | h1(|_: (), _: (), _: (), _: ()| {});
177 | ^^ ---------------------------- found signature defined here
179 | expected due to this
181 = note: expected closure signature `for<'a, 'b> fn(&'a (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>, &'b (), for<'a, 'b> fn(&'a (), &'b ())) -> _`
182 found closure signature `fn((), (), (), ()) -> _`
183 note: required by a bound in `h1`
184 --> $DIR/anonymous-higher-ranked-lifetime.rs:29:25
186 LL | fn h1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>, &(), fn(&(), &())) {}
187 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `h1`
188 help: consider borrowing the argument
190 LL | h1(|_: &(), _: (), _: &(), _: ()| {});
193 error[E0631]: type mismatch in closure arguments
194 --> $DIR/anonymous-higher-ranked-lifetime.rs:12:5
196 LL | h2(|_: (), _: (), _: (), _: ()| {});
197 | ^^ ---------------------------- found signature defined here
199 | expected due to this
201 = note: expected closure signature `for<'t0, 'a> fn(&'a (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>, &'t0 (), for<'a, 'b> fn(&'a (), &'b ())) -> _`
202 found closure signature `fn((), (), (), ()) -> _`
203 note: required by a bound in `h2`
204 --> $DIR/anonymous-higher-ranked-lifetime.rs:30:25
206 LL | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<dyn Fn(&())>, &'t0 (), fn(&(), &())) {}
207 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `h2`
208 help: consider borrowing the argument
210 LL | h2(|_: &(), _: (), _: &'t0 (), _: ()| {});
213 error: aborting due to 11 previous errors
215 For more information about this error, try `rustc --explain E0631`.