Open
Description
Code
fn main() {
async |_| {};
}
Current output
error[E0282]: type annotations needed
--> src/main.rs:2:15
|
2 | async |_| {};
| ^^ cannot infer type
Desired output
error[E0282]: type annotations needed
--> src/main.rs:2:7
|
2 | async |_| {};
| ^
|
help: consider giving this closure parameter an explicit type
|
2 | async |_: /* Type */| {};
| ++++++++++++
Rationale and extra context
diagnostics for non-async closures are better and already use this improved error
Other cases
Rust Version
1.88.0-nightly
(2025-03-29 1799887bb281d1ab4928)
Anything else?
@rustbot label A-async-closures