Closed
Description
The code
fn main() {
let a = None;
let c = |a: Option<_>| println!("{:?}", a);
c(a)
}
errors with
error[E0282]: type annotations needed
--> src/main.rs:3:14
|
2 | let a = None;
| - consider giving `a` a type
3 | let c = |a: Option<_>| println!("{:?}", a);
| ^ consider giving this closure parameter a type
which should be something like
error[E0282]: type annotations needed
--> src/main.rs:3:14
|
2 | let a = None;
| - consider giving `a` a type
3 | let c = |a: Option<_>| println!("{:?}", a);
| ^ cannot infer type for `_`