2022-11-06 01:38:57 +00:00
|
|
|
error[E0308]: mismatched types
|
2024-04-06 22:46:35 +00:00
|
|
|
--> $DIR/option-to-bool.rs:2:16
|
2022-11-06 01:38:57 +00:00
|
|
|
|
|
|
|
|
LL | if true && x {}
|
2023-01-03 02:00:33 +00:00
|
|
|
| ---- ^ expected `bool`, found `Option<i32>`
|
2022-12-02 23:56:37 +00:00
|
|
|
| |
|
|
|
|
| expected because this is `bool`
|
2022-11-06 01:38:57 +00:00
|
|
|
|
|
|
|
|
= note: expected type `bool`
|
|
|
|
found enum `Option<i32>`
|
|
|
|
help: use `Option::is_some` to test if the `Option` has a value
|
|
|
|
|
|
|
|
|
LL | if true && x.is_some() {}
|
|
|
|
| ++++++++++
|
|
|
|
|
2023-11-21 15:44:16 +00:00
|
|
|
error: aborting due to 1 previous error
|
2022-11-06 01:38:57 +00:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0308`.
|