-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
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 `_`
nbro, Globidev and meriy100DavisFrench and Corallus-Caninus
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.