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