]>
Commit | Line | Data |
---|---|---|
74b04a01 | 1 | error: functions cannot be both `const` and `async` |
ba9703b0 | 2 | --> $DIR/no-const-async.rs:4:5 |
dc9dc135 XL |
3 | | |
4 | LL | pub const async fn x() {} | |
ba9703b0 | 5 | | ----^^^^^-^^^^^---------- |
74b04a01 XL |
6 | | | | |
7 | | | `async` because of this | |
8 | | `const` because of this | |
dc9dc135 | 9 | |
5e7ed085 FG |
10 | error[E0391]: cycle detected when computing type of `x::{opaque#0}` |
11 | --> $DIR/no-const-async.rs:4:24 | |
12 | | | |
13 | LL | pub const async fn x() {} | |
14 | | ^ | |
15 | | | |
16 | note: ...which requires borrow-checking `x`... | |
17 | --> $DIR/no-const-async.rs:4:1 | |
18 | | | |
19 | LL | pub const async fn x() {} | |
20 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
2b03887a | 21 | note: ...which requires processing MIR for `x`... |
5e7ed085 FG |
22 | --> $DIR/no-const-async.rs:4:1 |
23 | | | |
24 | LL | pub const async fn x() {} | |
25 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
26 | note: ...which requires const checking `x`... | |
27 | --> $DIR/no-const-async.rs:4:1 | |
28 | | | |
29 | LL | pub const async fn x() {} | |
30 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
9ffffee4 FG |
31 | = note: ...which requires computing whether `x::{opaque#0}` is freeze... |
32 | = note: ...which requires evaluating trait selection obligation `x::{opaque#0}: core::marker::Freeze`... | |
5e7ed085 FG |
33 | = note: ...which again requires computing type of `x::{opaque#0}`, completing the cycle |
34 | note: cycle used when checking item types in top-level module | |
35 | --> $DIR/no-const-async.rs:4:1 | |
36 | | | |
37 | LL | pub const async fn x() {} | |
064997fb | 38 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
5e7ed085 FG |
39 | |
40 | error: aborting due to 2 previous errors | |
dc9dc135 | 41 | |
5e7ed085 | 42 | For more information about this error, try `rustc --explain E0391`. |