@@ -13,6 +13,14 @@ note: required by a bound in `f1`
1313 |
1414LL | fn f1<F>(_: F) where F: Fn(&(), &()) {}
1515 | ^^^^^^^^^^^^ required by this bound in `f1`
16+ help: hint: consider borrowing here:
17+ |
18+ LL | f1(|_: &(), _: ()| {});
19+ | ~~~
20+ help: hint: consider borrowing here:
21+ |
22+ LL | f1(|_: (), _: &()| {});
23+ | ~~~
1624
1725error[E0631]: type mismatch in closure arguments
1826 --> $DIR/anonymous-higher-ranked-lifetime.rs:3:5
@@ -29,6 +37,14 @@ note: required by a bound in `f2`
2937 |
3038LL | fn f2<F>(_: F) where F: for<'a> Fn(&'a (), &()) {}
3139 | ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `f2`
40+ help: hint: consider borrowing here:
41+ |
42+ LL | f2(|_: &'a (), _: ()| {});
43+ | ~~~~~~
44+ help: hint: consider borrowing here:
45+ |
46+ LL | f2(|_: (), _: &()| {});
47+ | ~~~
3248
3349error[E0631]: type mismatch in closure arguments
3450 --> $DIR/anonymous-higher-ranked-lifetime.rs:4:5
@@ -45,6 +61,14 @@ note: required by a bound in `f3`
4561 |
4662LL | fn f3<'a, F>(_: F) where F: Fn(&'a (), &()) {}
4763 | ^^^^^^^^^^^^^^^ required by this bound in `f3`
64+ help: hint: consider borrowing here:
65+ |
66+ LL | f3(|_: &(), _: ()| {});
67+ | ~~~
68+ help: hint: consider borrowing here:
69+ |
70+ LL | f3(|_: (), _: &()| {});
71+ | ~~~
4872
4973error[E0631]: type mismatch in closure arguments
5074 --> $DIR/anonymous-higher-ranked-lifetime.rs:5:5
@@ -61,6 +85,14 @@ note: required by a bound in `f4`
6185 |
6286LL | fn f4<F>(_: F) where F: for<'r> Fn(&(), &'r ()) {}
6387 | ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `f4`
88+ help: hint: consider borrowing here:
89+ |
90+ LL | f4(|_: &(), _: ()| {});
91+ | ~~~
92+ help: hint: consider borrowing here:
93+ |
94+ LL | f4(|_: (), _: &'r ()| {});
95+ | ~~~~~~
6496
6597error[E0631]: type mismatch in closure arguments
6698 --> $DIR/anonymous-higher-ranked-lifetime.rs:6:5
@@ -77,6 +109,14 @@ note: required by a bound in `f5`
77109 |
78110LL | fn f5<F>(_: F) where F: for<'r> Fn(&'r (), &'r ()) {}
79111 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `f5`
112+ help: hint: consider borrowing here:
113+ |
114+ LL | f5(|_: &'r (), _: ()| {});
115+ | ~~~~~~
116+ help: hint: consider borrowing here:
117+ |
118+ LL | f5(|_: (), _: &'r ()| {});
119+ | ~~~~~~
80120
81121error[E0631]: type mismatch in closure arguments
82122 --> $DIR/anonymous-higher-ranked-lifetime.rs:7:5
@@ -93,6 +133,10 @@ note: required by a bound in `g1`
93133 |
94134LL | fn g1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>) {}
95135 | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g1`
136+ help: hint: consider borrowing here:
137+ |
138+ LL | g1(|_: &(), _: ()| {});
139+ | ~~~
96140
97141error[E0631]: type mismatch in closure arguments
98142 --> $DIR/anonymous-higher-ranked-lifetime.rs:8:5
@@ -109,6 +153,10 @@ note: required by a bound in `g2`
109153 |
110154LL | fn g2<F>(_: F) where F: Fn(&(), fn(&())) {}
111155 | ^^^^^^^^^^^^^^^^ required by this bound in `g2`
156+ help: hint: consider borrowing here:
157+ |
158+ LL | g2(|_: &(), _: ()| {});
159+ | ~~~
112160
113161error[E0631]: type mismatch in closure arguments
114162 --> $DIR/anonymous-higher-ranked-lifetime.rs:9:5
@@ -125,6 +173,10 @@ note: required by a bound in `g3`
125173 |
126174LL | fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<dyn Fn(&())>) {}
127175 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g3`
176+ help: hint: consider borrowing here:
177+ |
178+ LL | g3(|_: &'s (), _: ()| {});
179+ | ~~~~~~
128180
129181error[E0631]: type mismatch in closure arguments
130182 --> $DIR/anonymous-higher-ranked-lifetime.rs:10:5
@@ -141,6 +193,10 @@ note: required by a bound in `g4`
141193 |
142194LL | fn g4<F>(_: F) where F: Fn(&(), for<'r> fn(&'r ())) {}
143195 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g4`
196+ help: hint: consider borrowing here:
197+ |
198+ LL | g4(|_: &(), _: ()| {});
199+ | ~~~
144200
145201error[E0631]: type mismatch in closure arguments
146202 --> $DIR/anonymous-higher-ranked-lifetime.rs:11:5
@@ -157,6 +213,14 @@ note: required by a bound in `h1`
157213 |
158214LL | fn h1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>, &(), fn(&(), &())) {}
159215 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `h1`
216+ help: hint: consider borrowing here:
217+ |
218+ LL | h1(|_: &(), _: (), _: (), _: ()| {});
219+ | ~~~
220+ help: hint: consider borrowing here:
221+ |
222+ LL | h1(|_: (), _: (), _: &(), _: ()| {});
223+ | ~~~
160224
161225error[E0631]: type mismatch in closure arguments
162226 --> $DIR/anonymous-higher-ranked-lifetime.rs:12:5
@@ -173,6 +237,14 @@ note: required by a bound in `h2`
173237 |
174238LL | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<dyn Fn(&())>, &'t0 (), fn(&(), &())) {}
175239 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `h2`
240+ help: hint: consider borrowing here:
241+ |
242+ LL | h2(|_: &(), _: (), _: (), _: ()| {});
243+ | ~~~
244+ help: hint: consider borrowing here:
245+ |
246+ LL | h2(|_: (), _: (), _: &'t0 (), _: ()| {});
247+ | ~~~~~~~
176248
177249error: aborting due to 11 previous errors
178250
0 commit comments