]> git.lizzy.rs Git - rust.git/blob - tests/ui/anonymous-higher-ranked-lifetime.stderr
add (currently ICEing) test
[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(|_: &(), _: &()| {});
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(|_: &(), _: &()| {});
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(|_: &(), _: &()| {});
99    |            +       +
100
101 error[E0631]: type mismatch in closure arguments
102   --> $DIR/anonymous-higher-ranked-lifetime.rs:7:5
103    |
104 LL |     g1(|_: (), _: ()| {});
105    |     ^^ -------------- found signature defined here
106    |     |
107    |     expected due to this
108    |
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
113    |
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
117    |
118 LL |     g1(|_: &(), _: ()| {});
119    |            +
120
121 error[E0631]: type mismatch in closure arguments
122   --> $DIR/anonymous-higher-ranked-lifetime.rs:8:5
123    |
124 LL |     g2(|_: (), _: ()| {});
125    |     ^^ -------------- found signature defined here
126    |     |
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 help: consider borrowing the argument
137    |
138 LL |     g2(|_: &(), _: ()| {});
139    |            +
140
141 error[E0631]: type mismatch in closure arguments
142   --> $DIR/anonymous-higher-ranked-lifetime.rs:9:5
143    |
144 LL |     g3(|_: (), _: ()| {});
145    |     ^^ -------------- found signature defined here
146    |     |
147    |     expected due to this
148    |
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
153    |
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
157    |
158 LL |     g3(|_: &(), _: ()| {});
159    |            +
160
161 error[E0631]: type mismatch in closure arguments
162   --> $DIR/anonymous-higher-ranked-lifetime.rs:10:5
163    |
164 LL |     g4(|_: (), _: ()| {});
165    |     ^^ -------------- found signature defined here
166    |     |
167    |     expected due to this
168    |
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
173    |
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
177    |
178 LL |     g4(|_: &(), _: ()| {});
179    |            +
180
181 error[E0631]: type mismatch in closure arguments
182   --> $DIR/anonymous-higher-ranked-lifetime.rs:11:5
183    |
184 LL |     h1(|_: (), _: (), _: (), _: ()| {});
185    |     ^^ ---------------------------- found signature defined here
186    |     |
187    |     expected due to this
188    |
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
193    |
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
197    |
198 LL |     h1(|_: &(), _: (), _: &(), _: ()| {});
199    |            +              +
200
201 error[E0631]: type mismatch in closure arguments
202   --> $DIR/anonymous-higher-ranked-lifetime.rs:12:5
203    |
204 LL |     h2(|_: (), _: (), _: (), _: ()| {});
205    |     ^^ ---------------------------- found signature defined here
206    |     |
207    |     expected due to this
208    |
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
213    |
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
217    |
218 LL |     h2(|_: &(), _: (), _: &(), _: ()| {});
219    |            +              +
220
221 error: aborting due to 11 previous errors
222
223 For more information about this error, try `rustc --explain E0631`.