1 error[E0308]: mismatched types
2 --> $DIR/expr-as-stmt-2.rs:3:26
4 LL | if let Some(x) = a { true } else { false }
5 | ---------------------^^^^-----------------
7 | | expected `()`, found `bool`
8 | expected this to be `()`
10 help: you might have meant to return this value
12 LL | if let Some(x) = a { return true; } else { false }
15 error[E0308]: mismatched types
16 --> $DIR/expr-as-stmt-2.rs:3:40
18 LL | if let Some(x) = a { true } else { false }
19 | -----------------------------------^^^^^--
21 | | expected `()`, found `bool`
22 | expected this to be `()`
24 help: you might have meant to return this value
26 LL | if let Some(x) = a { true } else { return false; }
29 error[E0308]: mismatched types
30 --> $DIR/expr-as-stmt-2.rs:6:5
32 LL | fn foo(a: Option<u32>, b: Option<u32>) -> bool {
33 | ---- expected `bool` because of return type
34 LL | if let Some(x) = a { true } else { false }
35 | ------------------------------------------ help: parentheses are required to parse this as an expression: `(if let Some(x) = a { true } else { false })`
38 LL | | if let Some(y) = a { true } else { false }
39 | |______________________________________________^ expected `bool`, found `&&bool`
41 error: aborting due to 3 previous errors
43 For more information about this error, try `rustc --explain E0308`.