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 | ---------------------^^^^------------------ help: consider using a semicolon here
7 | | expected `()`, found `bool`
8 | expected this to be `()`
10 error[E0308]: mismatched types
11 --> $DIR/expr-as-stmt-2.rs:3:40
13 LL | if let Some(x) = a { true } else { false }
14 | -----------------------------------^^^^^--- help: consider using a semicolon here
16 | | expected `()`, found `bool`
17 | expected this to be `()`
19 error[E0308]: mismatched types
20 --> $DIR/expr-as-stmt-2.rs:6:5
22 LL | fn foo(a: Option<u32>, b: Option<u32>) -> bool {
23 | ---- expected `bool` because of return type
24 LL | if let Some(x) = a { true } else { false }
25 | ------------------------------------------ help: parentheses are required to parse this as an expression: `(if let Some(x) = a { true } else { false })`
28 LL | | if let Some(y) = a { true } else { false }
29 | |______________________________________________^ expected `bool`, found `&&bool`
31 error: aborting due to 3 previous errors
33 For more information about this error, try `rustc --explain E0308`.