]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/no-const-async.stderr
Rollup merge of #93715 - GuillaumeGomez:horizontal-trim, r=notriddle
[rust.git] / src / test / ui / async-await / no-const-async.stderr
1 error: functions cannot be both `const` and `async`
2   --> $DIR/no-const-async.rs:4:5
3    |
4 LL | pub const async fn x() {}
5    | ----^^^^^-^^^^^----------
6    |     |     |
7    |     |     `async` because of this
8    |     `const` because of this
9
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    | ^^^^^^^^^^^^^^^^^^^^^^
21 note: ...which requires processing `x`...
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    | ^^^^^^^^^^^^^^^^^^^^^^
31    = note: ...which requires computing whether `impl core::future::future::Future<Output = ()>` is freeze...
32    = note: ...which requires evaluating trait selection obligation `impl core::future::future::Future<Output = ()>: core::marker::Freeze`...
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() {}
38    | ^^^^^^^^^^^^^^^^^^^^^^
39
40 error: aborting due to 2 previous errors
41
42 For more information about this error, try `rustc --explain E0391`.