about summary refs log tree commit diff
path: root/tests/ui/async-await/try-in-sync.stderr
blob: bc7a6bd015129279aefaf483ffbee8371901766d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
error[E0277]: the `?` operator can only be applied to values that implement `Try`
  --> $DIR/try-in-sync.rs:6:5
   |
LL |     foo()?;
   |     ^^^^^^ the `?` operator cannot be applied to type `impl Future<Output = Result<(), ()>>`
   |
   = help: the trait `Try` is not implemented for `impl Future<Output = Result<(), ()>>`
note: this implements `Future` and its output type supports `?`, but the future cannot be awaited in a synchronous function
  --> $DIR/try-in-sync.rs:6:10
   |
LL | fn main() -> Result<(), ()> {
   | --------------------------- this is not `async`
LL |     foo()?;
   |          ^

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0277`.