]> git.lizzy.rs Git - rust.git/blob - tests/ui/anonymous-higher-ranked-lifetime.stderr
Rollup merge of #106441 - mllken:abstract-socket-noref, r=joshtriplett
[rust.git] / tests / ui / anonymous-higher-ranked-lifetime.stderr
1 error[E0631]: type mismatch in closure arguments
2   --> $DIR/anonymous-higher-ranked-lifetime.rs:2:5
3    |
4 LL |     f1(|_: (), _: ()| {});
5    |     ^^ -------------- found signature defined here
6    |     |
7    |     expected due to this
8    |
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
13    |
14 LL | fn f1<F>(_: F) where F: Fn(&(), &()) {}
15    |                         ^^^^^^^^^^^^ required by this bound in `f1`
16 help: consider borrowing the argument
17    |
18 LL |     f1(|_: &(), _: &()| {});
19    |            ~~~     ~~~
20
21 error[E0631]: type mismatch in closure arguments
22   --> $DIR/anonymous-higher-ranked-lifetime.rs:3:5
23    |
24 LL |     f2(|_: (), _: ()| {});
25    |     ^^ -------------- found signature defined here
26    |     |
27    |     expected due to this
28    |
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
33    |
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
37    |
38 LL |     f2(|_: &'a (), _: &()| {});
39    |            ~~~~~~     ~~~
40
41 error[E0631]: type mismatch in closure arguments
42   --> $DIR/anonymous-higher-ranked-lifetime.rs:4:5
43    |
44 LL |     f3(|_: (), _: ()| {});
45    |     ^^ -------------- found signature defined here
46    |     |
47    |     expected due to this
48    |
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
53    |
54 LL | fn f3<'a, F>(_: F) where F: Fn(&'a (), &()) {}
55    |                             ^^^^^^^^^^^^^^^ required by this bound in `f3`
56 help: consider borrowing the argument
57    |
58 LL |     f3(|_: &(), _: &()| {});
59    |            ~~~     ~~~
60
61 error[E0631]: type mismatch in closure arguments
62   --> $DIR/anonymous-higher-ranked-lifetime.rs:5:5
63    |
64 LL |     f4(|_: (), _: ()| {});
65    |     ^^ -------------- found signature defined here
66    |     |
67    |     expected due to this
68    |
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
73    |
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
77    |
78 LL |     f4(|_: &(), _: &'r ()| {});
79    |            ~~~     ~~~~~~
80
81 error[E0631]: type mismatch in closure arguments
82   --> $DIR/anonymous-higher-ranked-lifetime.rs:6:5
83    |
84 LL |     f5(|_: (), _: ()| {});
85    |     ^^ -------------- found signature defined here
86    |     |
87    |     expected due to this
88    |
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
93    |
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
97    |
98 LL |     f5(|_: &'r (), _: &'r ()| {});
99    |            ~~~~~~     ~~~~~~
100
101 error[E0631]: type mismatch in closure arguments
102   --> $DIR/anonymous-higher-ranked-lifetime.rs:7:5
103    |
104 LL |     g1(|_: (), _: ()| {});
105    |     ^^ --------------
106    |     |  |   |
107    |     |  |   help: consider borrowing the argument: `&()`
108    |     |  found signature defined here
109    |     expected due to this
110    |
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
115    |
116 LL | fn g1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>) {}
117    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g1`
118
119 error[E0631]: type mismatch in closure arguments
120   --> $DIR/anonymous-higher-ranked-lifetime.rs:8:5
121    |
122 LL |     g2(|_: (), _: ()| {});
123    |     ^^ --------------
124    |     |  |   |
125    |     |  |   help: consider borrowing the argument: `&()`
126    |     |  found signature defined here
127    |     expected due to this
128    |
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
133    |
134 LL | fn g2<F>(_: F) where F: Fn(&(), fn(&())) {}
135    |                         ^^^^^^^^^^^^^^^^ required by this bound in `g2`
136
137 error[E0631]: type mismatch in closure arguments
138   --> $DIR/anonymous-higher-ranked-lifetime.rs:9:5
139    |
140 LL |     g3(|_: (), _: ()| {});
141    |     ^^ --------------
142    |     |  |   |
143    |     |  |   help: consider borrowing the argument: `&'s ()`
144    |     |  found signature defined here
145    |     expected due to this
146    |
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
151    |
152 LL | fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<dyn Fn(&())>) {}
153    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g3`
154
155 error[E0631]: type mismatch in closure arguments
156   --> $DIR/anonymous-higher-ranked-lifetime.rs:10:5
157    |
158 LL |     g4(|_: (), _: ()| {});
159    |     ^^ --------------
160    |     |  |   |
161    |     |  |   help: consider borrowing the argument: `&()`
162    |     |  found signature defined here
163    |     expected due to this
164    |
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
169    |
170 LL | fn g4<F>(_: F) where F: Fn(&(), for<'r> fn(&'r ())) {}
171    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g4`
172
173 error[E0631]: type mismatch in closure arguments
174   --> $DIR/anonymous-higher-ranked-lifetime.rs:11:5
175    |
176 LL |     h1(|_: (), _: (), _: (), _: ()| {});
177    |     ^^ ---------------------------- found signature defined here
178    |     |
179    |     expected due to this
180    |
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
185    |
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
189    |
190 LL |     h1(|_: &(), _: (), _: &(), _: ()| {});
191    |            ~~~            ~~~
192
193 error[E0631]: type mismatch in closure arguments
194   --> $DIR/anonymous-higher-ranked-lifetime.rs:12:5
195    |
196 LL |     h2(|_: (), _: (), _: (), _: ()| {});
197    |     ^^ ---------------------------- found signature defined here
198    |     |
199    |     expected due to this
200    |
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
205    |
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
209    |
210 LL |     h2(|_: &(), _: (), _: &'t0 (), _: ()| {});
211    |            ~~~            ~~~~~~~
212
213 error: aborting due to 11 previous errors
214
215 For more information about this error, try `rustc --explain E0631`.