error[E0277]: the `?` operator can only be applied to values that implement `Try` --> tests/ui/question-mark-await-type-error.rs:16:9 | 16 | async {}.await?; //~ ERROR the `?` operator can only be applied to values that implement `std::ops::Try` | ^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `()` | = help: the trait `Try` is not implemented for `()` error[E0277]: the `?` operator can only be used in an async function that returns `Result` or `Option` (or another type that implements `FromResidual`) --> tests/ui/question-mark-await-type-error.rs:16:23 | 14 | async fn async_fn() { | _____________________- 15 | | for _i in 1..2 { 16 | | async {}.await?; //~ ERROR the `?` operator can only be applied to values that implement `std::ops::Try` | | ^ cannot use the `?` operator in an async function that returns `()` 17 | | } 18 | | } | |_- this function should return `Result` or `Option` to accept `?` | = help: the trait `FromResidual<_>` is not implemented for `()` error[E0277]: the `?` operator can only be applied to values that implement `Try` --> tests/ui/question-mark-await-type-error.rs:23:18 | 23 | async {}.await?; //~ ERROR the `?` operator can only be applied to values that implement `std::ops::Try` | ^^^^^^ the `?` operator cannot be applied to type `()` | = help: the trait `Try` is not implemented for `()` error[E0277]: the `?` operator can only be used in a coroutine that returns `Result` or `Option` (or another type that implements `FromResidual`) --> tests/ui/question-mark-await-type-error.rs:23:23 | 20 | #[stream(item = i32)] | --------------------- this function should return `Result` or `Option` to accept `?` ... 23 | async {}.await?; //~ ERROR the `?` operator can only be applied to values that implement `std::ops::Try` | ^ cannot use the `?` operator in a coroutine that returns `()` | = help: the trait `FromResidual<_>` is not implemented for `()` error[E0277]: the `?` operator can only be applied to values that implement `Try` --> tests/ui/question-mark-await-type-error.rs:30:9 | 30 | async {}.await?; //~ ERROR the `?` operator can only be applied to values that implement `std::ops::Try` | ^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `()` | = help: the trait `Try` is not implemented for `()` error[E0277]: the `?` operator can only be used in an async function that returns `Result` or `Option` (or another type that implements `FromResidual`) --> tests/ui/question-mark-await-type-error.rs:30:23 | 27 | async fn async_fn_and_for_await() { | ___________________________________- 28 | | #[for_await] 29 | | for _i in stream(2) { 30 | | async {}.await?; //~ ERROR the `?` operator can only be applied to values that implement `std::ops::Try` | | ^ cannot use the `?` operator in an async function that returns `()` 31 | | } 32 | | } | |_- this function should return `Result` or `Option` to accept `?` | = help: the trait `FromResidual<_>` is not implemented for `()` error[E0277]: the `?` operator can only be applied to values that implement `Try` --> tests/ui/question-mark-await-type-error.rs:38:18 | 38 | async {}.await?; //~ ERROR the `?` operator can only be applied to values that implement `std::ops::Try` | ^^^^^^ the `?` operator cannot be applied to type `()` | = help: the trait `Try` is not implemented for `()` error[E0277]: the `?` operator can only be used in a coroutine that returns `Result` or `Option` (or another type that implements `FromResidual`) --> tests/ui/question-mark-await-type-error.rs:38:23 | 34 | #[stream(item = i32)] | --------------------- this function should return `Result` or `Option` to accept `?` ... 38 | async {}.await?; //~ ERROR the `?` operator can only be applied to values that implement `std::ops::Try` | ^ cannot use the `?` operator in a coroutine that returns `()` | = help: the trait `FromResidual<_>` is not implemented for `()`