error[E0308]: mismatched types
 --> tests/fail/macros_type_mismatch.rs:5:5
  |
5 |     Ok(())
  |     ^^^^^^ expected `()`, found `Result<(), _>`
  |
  = note: expected unit type `()`
                  found enum `Result<(), _>`
help: a return type might be missing here
  |
4 | async fn missing_semicolon_or_return_type() -> _ {
  |                                             ++++
help: consider using `Result::expect` to unwrap the `Result<(), _>` value, panicking if the value is a `Result::Err`
  |
5 |     Ok(()).expect("REASON")
  |           +++++++++++++++++

error[E0308]: mismatched types
  --> tests/fail/macros_type_mismatch.rs:10:5
   |
10 |     return Ok(());
   |     ^^^^^^^^^^^^^^ expected `()`, found `Result<(), _>`
   |
   = note: expected unit type `()`
                   found enum `Result<(), _>`
help: a return type might be missing here
   |
9  | async fn missing_return_type() -> _ {
   |                                ++++
help: consider using `Result::expect` to unwrap the `Result<(), _>` value, panicking if the value is a `Result::Err`
   |
10 |     return Ok(());.expect("REASON")
   |                   +++++++++++++++++

error[E0308]: mismatched types
  --> tests/fail/macros_type_mismatch.rs:23:5
   |
14 | async fn extra_semicolon() -> Result<(), ()> {
   |                               -------------- expected `Result<(), ()>` because of return type
...
23 |     Ok(());
   |     ^^^^^^^ expected `Result<(), ()>`, found `()`
   |
   = note:   expected enum `Result<(), ()>`
           found unit type `()`
help: try adding an expression at the end of the block
   |
23 ~     Ok(());;
24 +     Ok(())
   |

error[E0277]: the `?` operator can only be used in an async block that returns `Result` or `Option` (or another type that implements `FromResidual`)
  --> tests/fail/macros_type_mismatch.rs:40:9
   |
38 | #[tokio::main]
   | -------------- this function should return `Result` or `Option` to accept `?`
39 | async fn question_mark_operator_with_invalid_option() -> Option<()> {
40 |     None?;
   |         ^ cannot use the `?` operator in an async block that returns `()`

error[E0308]: mismatched types
  --> tests/fail/macros_type_mismatch.rs:40:5
   |
39 | async fn question_mark_operator_with_invalid_option() -> Option<()> {
   |                                                          ---------- expected `Option<()>` because of return type
40 |     None?;
   |     ^^^^^^ expected `Option<()>`, found `()`
   |
   = note:   expected enum `Option<()>`
           found unit type `()`
help: try adding an expression at the end of the block
   |
40 ~     None?;;
41 +     None
   |
40 ~     None?;;
41 +     Some(())
   |

error[E0277]: the `?` operator can only be used in an async block that returns `Result` or `Option` (or another type that implements `FromResidual`)
  --> tests/fail/macros_type_mismatch.rs:57:11
   |
55 | #[tokio::main]
   | -------------- this function should return `Result` or `Option` to accept `?`
56 | async fn question_mark_operator_with_invalid_result() -> Result<(), ()> {
57 |     Ok(())?;
   |           ^ cannot use the `?` operator in an async block that returns `()`

error[E0308]: mismatched types
  --> tests/fail/macros_type_mismatch.rs:57:5
   |
56 | async fn question_mark_operator_with_invalid_result() -> Result<(), ()> {
   |                                                          -------------- expected `Result<(), ()>` because of return type
57 |     Ok(())?;
   |     ^^^^^^^^ expected `Result<(), ()>`, found `()`
   |
   = note:   expected enum `Result<(), ()>`
           found unit type `()`
help: try adding an expression at the end of the block
   |
57 ~     Ok(())?;;
58 +     Ok(())
   |

error[E0308]: mismatched types
  --> tests/fail/macros_type_mismatch.rs:66:5
   |
64 | async fn issue_4635() {
   |                      - help: try adding a return type: `-> i32`
65 |     return 1;
66 |     ;
   |     ^ expected `()`, found integer
