Repository: rust
Issue: Confusing diagnostic suggesting to remove `.await` in attribute macro
Labels: A-diagnostics,T-compiler

<!--
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
along with any information you feel relevant to replicating the bug.

If you cannot produce a minimal reproduction case (something that would work in
isolation), please provide the steps or even link to a repository that causes
the problematic output to occur.
-->

Given the following code, using `wasm_bindgen` combined with `tokio`: <!-- Please provide a link to play.rust-lang.org -->

```rust
#[wasm_bindgen]
#[tokio::main]
pub async fn main() {
    let stdin = tokio::io::stdin();
    let stdout = tokio::io::stdout();

    let (service, socket) = LspService::new(|client| Backend { client });
    Server::new(stdin, stdout, socket).serve(service).await;
}
```

One of the given errors is:

```
error[E0277]: `()` is not a future
  --> src\lib.rs:36:1
   |
36 | #[wasm_bindgen]
   | ^^^^^^^^^^^^^^^ `()` is not a future
   |
   = help: the trait `Future` is not implemented for `()`
   = note: () must be a future or must implement `IntoFuture` to be awaited
   = note: required because of the requirements on the impl of `IntoFuture` for `()`
help: remove the `.await`
   |
36 - #[wasm_bindgen]
36 + #[wasm_bindgen]
   | 
```

While I'm sure that what I implemented doesn't make sense, the particular suggestion

```
help: remove the `.await`
   |
36 - #[wasm_bindgen]
36 + #[wasm_bindgen]
   | 
```

is very confusing to me.

<!--
If the problem is not self-explanatory, please provide a rationale for the
change.
-->

<!--
If dramatically different output is caused by small changes, consider also
adding them here.

If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions. The output might also be
different depending on the Edition.
-->

## More info

`rustc --version --verbose`:
```
rustc 1.61.0-nightly (335ffbfa5 2022-03-11)
binary: rustc
commit-hash: 335ffbfa547df94ac236f5c56130cecf99c8d82b
commit-date: 2022-03-11
host: x86_64-pc-windows-msvc
release: 1.61.0-nightly
LLVM version: 14.0.0
```

If you want to reproduce, you can use commit [`5acb4d7`](https://github.com/TimJentzsch/tower-lsp-wasm/commit/5acb4d772c5d36b1c0bc71fe16e0005858895e22) of https://github.com/TimJentzsch/tower-lsp-wasm, which is a rather small project.

<details><summary><strong>Full `cargo check` output</strong></summary>
<p>

```
error: the `async` keyword is missing from the function declaration
  --> src\lib.rs:36:1
   |
36 | #[wasm_bindgen]
   | ^^^^^^^^^^^^^^^
   |
   = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: use of undeclared crate or module `wasm_bindgen_futures`
  --> src\lib.rs:36:1
   |
36 | #[wasm_bindgen]
   | ^^^^^^^^^^^^^^^ use of undeclared crate or module `wasm_bindgen_futures`
   |
   = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `()` is not a future
  --> src\lib.rs:36:1
   |
36 | #[wasm_bindgen]
   | ^^^^^^^^^^^^^^^ `()` is not a future
   |
   = help: the trait `Future` is not implemented for `()`
   = note: () must be a future or must implement `IntoFuture` to be awaited
   = note: required because of the requirements on the impl of `IntoFuture` for `()`
help: remove the `.await`
   |
36 - #[wasm_bindgen]
36 + #[wasm_bindgen]
   | 

Some errors have detailed explanations: E0277, E0433.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `tower-lsp-wasm` due to 3 previous errors
```

</p>
</details>