-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Also suggest Some when an Option<T> is expected, but T is given #42764
Copy link
Copy link
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints
Description
let i: Option<i32> = 42i32;produces
error[E0308]: mismatched types
--> <anon>:2:26
|
2 | let i: Option<i32> = 42i32;
| ^^^^^ expected enum `std::option::Option`, found i32
|
= note: expected type `std::option::Option<i32>`
found type `i32`
= help: here are some functions which might fulfill your needs:
- .checked_abs()
- .checked_neg()
I think the first item in this list should be Some
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints
Type
Fields
Give feedbackNo fields configured for issues without a type.