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(|_: &(), _: &()| {});
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(|_: &(), _: &()| {});
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(|_: &(), _: &()| {});
101 error[E0631]: type mismatch in closure arguments
102 --> $DIR/anonymous-higher-ranked-lifetime.rs:7:5
104 LL | g1(|_: (), _: ()| {});
105 | ^^ -------------- found signature defined here
107 | expected due to this
109 = note: expected closure signature `for<'a> fn(&'a (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>) -> _`
110 found closure signature `fn((), ()) -> _`
111 note: required by a bound in `g1`
112 --> $DIR/anonymous-higher-ranked-lifetime.rs:23:25
114 LL | fn g1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>) {}
115 | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g1`
116 help: consider borrowing the argument
118 LL | g1(|_: &(), _: ()| {});
121 error[E0631]: type mismatch in closure arguments
122 --> $DIR/anonymous-higher-ranked-lifetime.rs:8:5
124 LL | g2(|_: (), _: ()| {});
125 | ^^ -------------- 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`
136 help: consider borrowing the argument
138 LL | g2(|_: &(), _: ()| {});
141 error[E0631]: type mismatch in closure arguments
142 --> $DIR/anonymous-higher-ranked-lifetime.rs:9:5
144 LL | g3(|_: (), _: ()| {});
145 | ^^ -------------- found signature defined here
147 | expected due to this
149 = note: expected closure signature `for<'s> fn(&'s (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>) -> _`
150 found closure signature `fn((), ()) -> _`
151 note: required by a bound in `g3`
152 --> $DIR/anonymous-higher-ranked-lifetime.rs:25:25
154 LL | fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<dyn Fn(&())>) {}
155 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g3`
156 help: consider borrowing the argument
158 LL | g3(|_: &(), _: ()| {});
161 error[E0631]: type mismatch in closure arguments
162 --> $DIR/anonymous-higher-ranked-lifetime.rs:10:5
164 LL | g4(|_: (), _: ()| {});
165 | ^^ -------------- found signature defined here
167 | expected due to this
169 = note: expected closure signature `for<'a> fn(&'a (), for<'r> fn(&'r ())) -> _`
170 found closure signature `fn((), ()) -> _`
171 note: required by a bound in `g4`
172 --> $DIR/anonymous-higher-ranked-lifetime.rs:26:25
174 LL | fn g4<F>(_: F) where F: Fn(&(), for<'r> fn(&'r ())) {}
175 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g4`
176 help: consider borrowing the argument
178 LL | g4(|_: &(), _: ()| {});
181 error[E0631]: type mismatch in closure arguments
182 --> $DIR/anonymous-higher-ranked-lifetime.rs:11:5
184 LL | h1(|_: (), _: (), _: (), _: ()| {});
185 | ^^ ---------------------------- found signature defined here
187 | expected due to this
189 = note: expected closure signature `for<'a, 'b> fn(&'a (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>, &'b (), for<'a, 'b> fn(&'a (), &'b ())) -> _`
190 found closure signature `fn((), (), (), ()) -> _`
191 note: required by a bound in `h1`
192 --> $DIR/anonymous-higher-ranked-lifetime.rs:29:25
194 LL | fn h1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>, &(), fn(&(), &())) {}
195 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `h1`
196 help: consider borrowing the argument
198 LL | h1(|_: &(), _: (), _: &(), _: ()| {});
201 error[E0631]: type mismatch in closure arguments
202 --> $DIR/anonymous-higher-ranked-lifetime.rs:12:5
204 LL | h2(|_: (), _: (), _: (), _: ()| {});
205 | ^^ ---------------------------- found signature defined here
207 | expected due to this
209 = note: expected closure signature `for<'t0, 'a> fn(&'a (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>, &'t0 (), for<'a, 'b> fn(&'a (), &'b ())) -> _`
210 found closure signature `fn((), (), (), ()) -> _`
211 note: required by a bound in `h2`
212 --> $DIR/anonymous-higher-ranked-lifetime.rs:30:25
214 LL | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<dyn Fn(&())>, &'t0 (), fn(&(), &())) {}
215 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `h2`
216 help: consider borrowing the argument
218 LL | h2(|_: &(), _: (), _: &(), _: ()| {});
221 error: aborting due to 11 previous errors
223 For more information about this error, try `rustc --explain E0631`.