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 here:
18 LL | f1(|_: &(), _: ()| {});
20 help: consider borrowing here:
22 LL | f1(|_: (), _: &()| {});
25 error[E0631]: type mismatch in closure arguments
26 --> $DIR/anonymous-higher-ranked-lifetime.rs:3:5
28 LL | f2(|_: (), _: ()| {});
29 | ^^ -------------- found signature defined here
31 | expected due to this
33 = note: expected closure signature `for<'a, 'b> fn(&'a (), &'b ()) -> _`
34 found closure signature `fn((), ()) -> _`
35 note: required by a bound in `f2`
36 --> $DIR/anonymous-higher-ranked-lifetime.rs:17:25
38 LL | fn f2<F>(_: F) where F: for<'a> Fn(&'a (), &()) {}
39 | ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `f2`
40 help: consider borrowing here:
42 LL | f2(|_: &'a (), _: ()| {});
44 help: consider borrowing here:
46 LL | f2(|_: (), _: &()| {});
49 error[E0631]: type mismatch in closure arguments
50 --> $DIR/anonymous-higher-ranked-lifetime.rs:4:5
52 LL | f3(|_: (), _: ()| {});
53 | ^^ -------------- found signature defined here
55 | expected due to this
57 = note: expected closure signature `for<'a> fn(&(), &'a ()) -> _`
58 found closure signature `fn((), ()) -> _`
59 note: required by a bound in `f3`
60 --> $DIR/anonymous-higher-ranked-lifetime.rs:18:29
62 LL | fn f3<'a, F>(_: F) where F: Fn(&'a (), &()) {}
63 | ^^^^^^^^^^^^^^^ required by this bound in `f3`
64 help: consider borrowing here:
66 LL | f3(|_: &(), _: ()| {});
68 help: consider borrowing here:
70 LL | f3(|_: (), _: &()| {});
73 error[E0631]: type mismatch in closure arguments
74 --> $DIR/anonymous-higher-ranked-lifetime.rs:5:5
76 LL | f4(|_: (), _: ()| {});
77 | ^^ -------------- found signature defined here
79 | expected due to this
81 = note: expected closure signature `for<'r, 'a> fn(&'a (), &'r ()) -> _`
82 found closure signature `fn((), ()) -> _`
83 note: required by a bound in `f4`
84 --> $DIR/anonymous-higher-ranked-lifetime.rs:19:25
86 LL | fn f4<F>(_: F) where F: for<'r> Fn(&(), &'r ()) {}
87 | ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `f4`
88 help: consider borrowing here:
90 LL | f4(|_: &(), _: ()| {});
92 help: consider borrowing here:
94 LL | f4(|_: (), _: &'r ()| {});
97 error[E0631]: type mismatch in closure arguments
98 --> $DIR/anonymous-higher-ranked-lifetime.rs:6:5
100 LL | f5(|_: (), _: ()| {});
101 | ^^ -------------- found signature defined here
103 | expected due to this
105 = note: expected closure signature `for<'r> fn(&'r (), &'r ()) -> _`
106 found closure signature `fn((), ()) -> _`
107 note: required by a bound in `f5`
108 --> $DIR/anonymous-higher-ranked-lifetime.rs:20:25
110 LL | fn f5<F>(_: F) where F: for<'r> Fn(&'r (), &'r ()) {}
111 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `f5`
112 help: consider borrowing here:
114 LL | f5(|_: &'r (), _: ()| {});
116 help: consider borrowing here:
118 LL | f5(|_: (), _: &'r ()| {});
121 error[E0631]: type mismatch in closure arguments
122 --> $DIR/anonymous-higher-ranked-lifetime.rs:7:5
124 LL | g1(|_: (), _: ()| {});
125 | ^^ -------------- found signature defined here
127 | expected due to this
129 = note: expected closure signature `for<'a> fn(&'a (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>) -> _`
130 found closure signature `fn((), ()) -> _`
131 note: required by a bound in `g1`
132 --> $DIR/anonymous-higher-ranked-lifetime.rs:23:25
134 LL | fn g1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>) {}
135 | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g1`
136 help: consider borrowing here:
138 LL | g1(|_: &(), _: ()| {});
141 error[E0631]: type mismatch in closure arguments
142 --> $DIR/anonymous-higher-ranked-lifetime.rs:8:5
144 LL | g2(|_: (), _: ()| {});
145 | ^^ -------------- found signature defined here
147 | expected due to this
149 = note: expected closure signature `for<'a> fn(&'a (), for<'a> fn(&'a ())) -> _`
150 found closure signature `fn((), ()) -> _`
151 note: required by a bound in `g2`
152 --> $DIR/anonymous-higher-ranked-lifetime.rs:24:25
154 LL | fn g2<F>(_: F) where F: Fn(&(), fn(&())) {}
155 | ^^^^^^^^^^^^^^^^ required by this bound in `g2`
156 help: consider borrowing here:
158 LL | g2(|_: &(), _: ()| {});
161 error[E0631]: type mismatch in closure arguments
162 --> $DIR/anonymous-higher-ranked-lifetime.rs:9:5
164 LL | g3(|_: (), _: ()| {});
165 | ^^ -------------- found signature defined here
167 | expected due to this
169 = note: expected closure signature `for<'s> fn(&'s (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>) -> _`
170 found closure signature `fn((), ()) -> _`
171 note: required by a bound in `g3`
172 --> $DIR/anonymous-higher-ranked-lifetime.rs:25:25
174 LL | fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<dyn Fn(&())>) {}
175 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g3`
176 help: consider borrowing here:
178 LL | g3(|_: &'s (), _: ()| {});
181 error[E0631]: type mismatch in closure arguments
182 --> $DIR/anonymous-higher-ranked-lifetime.rs:10:5
184 LL | g4(|_: (), _: ()| {});
185 | ^^ -------------- found signature defined here
187 | expected due to this
189 = note: expected closure signature `for<'a> fn(&'a (), for<'r> fn(&'r ())) -> _`
190 found closure signature `fn((), ()) -> _`
191 note: required by a bound in `g4`
192 --> $DIR/anonymous-higher-ranked-lifetime.rs:26:25
194 LL | fn g4<F>(_: F) where F: Fn(&(), for<'r> fn(&'r ())) {}
195 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g4`
196 help: consider borrowing here:
198 LL | g4(|_: &(), _: ()| {});
201 error[E0631]: type mismatch in closure arguments
202 --> $DIR/anonymous-higher-ranked-lifetime.rs:11:5
204 LL | h1(|_: (), _: (), _: (), _: ()| {});
205 | ^^ ---------------------------- found signature defined here
207 | expected due to this
209 = note: expected closure signature `for<'a, 'b> fn(&'a (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>, &'b (), for<'a, 'b> fn(&'a (), &'b ())) -> _`
210 found closure signature `fn((), (), (), ()) -> _`
211 note: required by a bound in `h1`
212 --> $DIR/anonymous-higher-ranked-lifetime.rs:29:25
214 LL | fn h1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>, &(), fn(&(), &())) {}
215 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `h1`
216 help: consider borrowing here:
218 LL | h1(|_: &(), _: (), _: (), _: ()| {});
220 help: consider borrowing here:
222 LL | h1(|_: (), _: (), _: &(), _: ()| {});
225 error[E0631]: type mismatch in closure arguments
226 --> $DIR/anonymous-higher-ranked-lifetime.rs:12:5
228 LL | h2(|_: (), _: (), _: (), _: ()| {});
229 | ^^ ---------------------------- found signature defined here
231 | expected due to this
233 = note: expected closure signature `for<'t0, 'a> fn(&'a (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>, &'t0 (), for<'a, 'b> fn(&'a (), &'b ())) -> _`
234 found closure signature `fn((), (), (), ()) -> _`
235 note: required by a bound in `h2`
236 --> $DIR/anonymous-higher-ranked-lifetime.rs:30:25
238 LL | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<dyn Fn(&())>, &'t0 (), fn(&(), &())) {}
239 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `h2`
240 help: consider borrowing here:
242 LL | h2(|_: &(), _: (), _: (), _: ()| {});
244 help: consider borrowing here:
246 LL | h2(|_: (), _: (), _: &'t0 (), _: ()| {});
249 error: aborting due to 11 previous errors
251 For more information about this error, try `rustc --explain E0631`.