]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/fn-header-semantic-fail.stderr
Rollup merge of #99480 - miam-miam100:arg-format, r=oli-obk
[rust.git] / src / test / ui / parser / fn-header-semantic-fail.stderr
1 error: functions cannot be both `const` and `async`
2   --> $DIR/fn-header-semantic-fail.rs:12:5
3    |
4 LL |     const async unsafe extern "C" fn ff5() {}
5    |     ^^^^^-^^^^^------------------------------
6    |     |     |
7    |     |     `async` because of this
8    |     `const` because of this
9
10 error[E0706]: functions in traits cannot be declared `async`
11   --> $DIR/fn-header-semantic-fail.rs:17:9
12    |
13 LL |         async fn ft1();
14    |         -----^^^^^^^^^^
15    |         |
16    |         `async` because of this
17    |
18    = note: `async` trait functions are not currently supported
19    = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
20
21 error[E0379]: functions in traits cannot be declared const
22   --> $DIR/fn-header-semantic-fail.rs:19:9
23    |
24 LL |         const fn ft3();
25    |         ^^^^^ functions in traits cannot be const
26
27 error[E0379]: functions in traits cannot be declared const
28   --> $DIR/fn-header-semantic-fail.rs:21:9
29    |
30 LL |         const async unsafe extern "C" fn ft5();
31    |         ^^^^^ functions in traits cannot be const
32
33 error[E0706]: functions in traits cannot be declared `async`
34   --> $DIR/fn-header-semantic-fail.rs:21:9
35    |
36 LL |         const async unsafe extern "C" fn ft5();
37    |         ^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38    |               |
39    |               `async` because of this
40    |
41    = note: `async` trait functions are not currently supported
42    = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
43
44 error: functions cannot be both `const` and `async`
45   --> $DIR/fn-header-semantic-fail.rs:21:9
46    |
47 LL |         const async unsafe extern "C" fn ft5();
48    |         ^^^^^-^^^^^----------------------------
49    |         |     |
50    |         |     `async` because of this
51    |         `const` because of this
52
53 error[E0706]: functions in traits cannot be declared `async`
54   --> $DIR/fn-header-semantic-fail.rs:29:9
55    |
56 LL |         async fn ft1() {}
57    |         -----^^^^^^^^^^^^
58    |         |
59    |         `async` because of this
60    |
61    = note: `async` trait functions are not currently supported
62    = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
63
64 error[E0379]: functions in traits cannot be declared const
65   --> $DIR/fn-header-semantic-fail.rs:32:9
66    |
67 LL |         const fn ft3() {}
68    |         ^^^^^ functions in traits cannot be const
69
70 error[E0379]: functions in traits cannot be declared const
71   --> $DIR/fn-header-semantic-fail.rs:34:9
72    |
73 LL |         const async unsafe extern "C" fn ft5() {}
74    |         ^^^^^ functions in traits cannot be const
75
76 error[E0706]: functions in traits cannot be declared `async`
77   --> $DIR/fn-header-semantic-fail.rs:34:9
78    |
79 LL |         const async unsafe extern "C" fn ft5() {}
80    |         ^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
81    |               |
82    |               `async` because of this
83    |
84    = note: `async` trait functions are not currently supported
85    = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
86
87 error: functions cannot be both `const` and `async`
88   --> $DIR/fn-header-semantic-fail.rs:34:9
89    |
90 LL |         const async unsafe extern "C" fn ft5() {}
91    |         ^^^^^-^^^^^------------------------------
92    |         |     |
93    |         |     `async` because of this
94    |         `const` because of this
95
96 error: functions cannot be both `const` and `async`
97   --> $DIR/fn-header-semantic-fail.rs:47:9
98    |
99 LL |         const async unsafe extern "C" fn fi5() {}
100    |         ^^^^^-^^^^^------------------------------
101    |         |     |
102    |         |     `async` because of this
103    |         `const` because of this
104
105 error: functions in `extern` blocks cannot have qualifiers
106   --> $DIR/fn-header-semantic-fail.rs:53:18
107    |
108 LL |     extern "C" {
109    |     ---------- in this `extern` block
110 LL |         async fn fe1();
111    |                  ^^^
112    |
113 help: remove the qualifiers
114    |
115 LL |         fn fe1();
116    |         ~~
117
118 error: functions in `extern` blocks cannot have qualifiers
119   --> $DIR/fn-header-semantic-fail.rs:54:19
120    |
121 LL |     extern "C" {
122    |     ---------- in this `extern` block
123 LL |         async fn fe1();
124 LL |         unsafe fn fe2();
125    |                   ^^^
126    |
127 help: remove the qualifiers
128    |
129 LL |         fn fe2();
130    |         ~~
131
132 error: functions in `extern` blocks cannot have qualifiers
133   --> $DIR/fn-header-semantic-fail.rs:55:18
134    |
135 LL |     extern "C" {
136    |     ---------- in this `extern` block
137 ...
138 LL |         const fn fe3();
139    |                  ^^^
140    |
141 help: remove the qualifiers
142    |
143 LL |         fn fe3();
144    |         ~~
145
146 error: functions in `extern` blocks cannot have qualifiers
147   --> $DIR/fn-header-semantic-fail.rs:56:23
148    |
149 LL |     extern "C" {
150    |     ---------- in this `extern` block
151 ...
152 LL |         extern "C" fn fe4();
153    |                       ^^^
154    |
155 help: remove the qualifiers
156    |
157 LL |         fn fe4();
158    |         ~~
159
160 error: functions in `extern` blocks cannot have qualifiers
161   --> $DIR/fn-header-semantic-fail.rs:57:42
162    |
163 LL |     extern "C" {
164    |     ---------- in this `extern` block
165 ...
166 LL |         const async unsafe extern "C" fn fe5();
167    |                                          ^^^
168    |
169 help: remove the qualifiers
170    |
171 LL |         fn fe5();
172    |         ~~
173
174 error: functions cannot be both `const` and `async`
175   --> $DIR/fn-header-semantic-fail.rs:57:9
176    |
177 LL |         const async unsafe extern "C" fn fe5();
178    |         ^^^^^-^^^^^----------------------------
179    |         |     |
180    |         |     `async` because of this
181    |         `const` because of this
182
183 error[E0391]: cycle detected when computing type of `main::ff5::{opaque#0}`
184   --> $DIR/fn-header-semantic-fail.rs:12:44
185    |
186 LL |     const async unsafe extern "C" fn ff5() {}
187    |                                            ^
188    |
189 note: ...which requires borrow-checking `main::ff5`...
190   --> $DIR/fn-header-semantic-fail.rs:12:5
191    |
192 LL |     const async unsafe extern "C" fn ff5() {}
193    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
194 note: ...which requires processing `main::ff5`...
195   --> $DIR/fn-header-semantic-fail.rs:12:5
196    |
197 LL |     const async unsafe extern "C" fn ff5() {}
198    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
199 note: ...which requires const checking `main::ff5`...
200   --> $DIR/fn-header-semantic-fail.rs:12:5
201    |
202 LL |     const async unsafe extern "C" fn ff5() {}
203    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
204    = note: ...which requires computing whether `impl core::future::future::Future<Output = ()>` is freeze...
205    = note: ...which requires evaluating trait selection obligation `impl core::future::future::Future<Output = ()>: core::marker::Freeze`...
206    = note: ...which again requires computing type of `main::ff5::{opaque#0}`, completing the cycle
207 note: cycle used when checking item types in top-level module
208   --> $DIR/fn-header-semantic-fail.rs:5:1
209    |
210 LL | / #![feature(const_extern_fn)]
211 LL | |
212 LL | | fn main() {
213 LL | |     async fn ff1() {} // OK.
214 ...  |
215 LL | |     }
216 LL | | }
217    | |_^
218
219 error[E0053]: method `ft1` has an incompatible type for trait
220   --> $DIR/fn-header-semantic-fail.rs:29:24
221    |
222 LL |         async fn ft1() {}
223    |                        ^
224    |                        |
225    |                        checked the `Output` of this `async fn`, found opaque type
226    |                        expected `()`, found opaque type
227    |
228    = note: while checking the return type of the `async fn`
229 note: type in trait
230   --> $DIR/fn-header-semantic-fail.rs:17:23
231    |
232 LL |         async fn ft1();
233    |                       ^
234    = note: expected fn pointer `fn()`
235               found fn pointer `fn() -> impl Future<Output = ()>`
236
237 error[E0053]: method `ft5` has an incompatible type for trait
238   --> $DIR/fn-header-semantic-fail.rs:34:48
239    |
240 LL |         const async unsafe extern "C" fn ft5() {}
241    |                                                ^
242    |                                                |
243    |                                                checked the `Output` of this `async fn`, found opaque type
244    |                                                expected `()`, found opaque type
245    |
246    = note: while checking the return type of the `async fn`
247 note: type in trait
248   --> $DIR/fn-header-semantic-fail.rs:21:47
249    |
250 LL |         const async unsafe extern "C" fn ft5();
251    |                                               ^
252    = note: expected fn pointer `unsafe extern "C" fn()`
253               found fn pointer `unsafe extern "C" fn() -> impl Future<Output = ()>`
254
255 error[E0391]: cycle detected when computing type of `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5::{opaque#0}`
256   --> $DIR/fn-header-semantic-fail.rs:34:48
257    |
258 LL |         const async unsafe extern "C" fn ft5() {}
259    |                                                ^
260    |
261 note: ...which requires borrow-checking `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5`...
262   --> $DIR/fn-header-semantic-fail.rs:34:9
263    |
264 LL |         const async unsafe extern "C" fn ft5() {}
265    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
266 note: ...which requires processing `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5`...
267   --> $DIR/fn-header-semantic-fail.rs:34:9
268    |
269 LL |         const async unsafe extern "C" fn ft5() {}
270    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
271 note: ...which requires const checking `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5`...
272   --> $DIR/fn-header-semantic-fail.rs:34:9
273    |
274 LL |         const async unsafe extern "C" fn ft5() {}
275    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
276    = note: ...which requires computing whether `impl core::future::future::Future<Output = ()>` is freeze...
277    = note: ...which requires evaluating trait selection obligation `impl core::future::future::Future<Output = ()>: core::marker::Freeze`...
278    = note: ...which again requires computing type of `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5::{opaque#0}`, completing the cycle
279 note: cycle used when checking item types in top-level module
280   --> $DIR/fn-header-semantic-fail.rs:5:1
281    |
282 LL | / #![feature(const_extern_fn)]
283 LL | |
284 LL | | fn main() {
285 LL | |     async fn ff1() {} // OK.
286 ...  |
287 LL | |     }
288 LL | | }
289    | |_^
290
291 error[E0391]: cycle detected when computing type of `main::<impl at $DIR/fn-header-semantic-fail.rs:42:5: 42:11>::fi5::{opaque#0}`
292   --> $DIR/fn-header-semantic-fail.rs:47:48
293    |
294 LL |         const async unsafe extern "C" fn fi5() {}
295    |                                                ^
296    |
297 note: ...which requires borrow-checking `main::<impl at $DIR/fn-header-semantic-fail.rs:42:5: 42:11>::fi5`...
298   --> $DIR/fn-header-semantic-fail.rs:47:9
299    |
300 LL |         const async unsafe extern "C" fn fi5() {}
301    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
302 note: ...which requires processing `main::<impl at $DIR/fn-header-semantic-fail.rs:42:5: 42:11>::fi5`...
303   --> $DIR/fn-header-semantic-fail.rs:47:9
304    |
305 LL |         const async unsafe extern "C" fn fi5() {}
306    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
307 note: ...which requires const checking `main::<impl at $DIR/fn-header-semantic-fail.rs:42:5: 42:11>::fi5`...
308   --> $DIR/fn-header-semantic-fail.rs:47:9
309    |
310 LL |         const async unsafe extern "C" fn fi5() {}
311    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
312    = note: ...which requires computing whether `impl core::future::future::Future<Output = ()>` is freeze...
313    = note: ...which requires evaluating trait selection obligation `impl core::future::future::Future<Output = ()>: core::marker::Freeze`...
314    = note: ...which again requires computing type of `main::<impl at $DIR/fn-header-semantic-fail.rs:42:5: 42:11>::fi5::{opaque#0}`, completing the cycle
315 note: cycle used when checking item types in top-level module
316   --> $DIR/fn-header-semantic-fail.rs:5:1
317    |
318 LL | / #![feature(const_extern_fn)]
319 LL | |
320 LL | | fn main() {
321 LL | |     async fn ff1() {} // OK.
322 ...  |
323 LL | |     }
324 LL | | }
325    | |_^
326
327 error: aborting due to 23 previous errors
328
329 Some errors have detailed explanations: E0053, E0379, E0391, E0706.
330 For more information about an error, try `rustc --explain E0053`.