Closed
Description
Code
async fn do_async() {}
fn main() {
Some(do_async()).map(|()| {});
}
Current output
Compiling playground v0.0.1 (/playground)
error[E0308]: mismatched types
--> src/main.rs:4:27
|
4 | Some(do_async()).map(|()| {});
| ^^
| |
| expected future, found `()`
| expected due to this
|
= note: expected opaque type `impl Future<Output = ()>`
found unit type `()`
help: consider `await`ing on the `Future`
|
4 | Some(do_async()).map(|().await| {});
| ++++++
For more information about this error, try `rustc --explain E0308`.
error: could not compile `playground` (bin "playground") due to 1 previous error
Desired output
Don't suggest awaiting.
Rationale and extra context
No response
Other cases
No response
Rust Version
Playground's stable rust (1.79.0)
Anything else?
Found by 0xbadbeef_60104 on the official rust discord.