]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/expr-as-stmt-2.stderr
Add 'compiler/rustc_codegen_cranelift/' from commit '793d26047f994e23415f8f6bb5686ff2...
[rust.git] / src / test / ui / parser / expr-as-stmt-2.stderr
1 error[E0308]: mismatched types
2   --> $DIR/expr-as-stmt-2.rs:3:26
3    |
4 LL |     if let Some(x) = a { true } else { false }
5    |     ---------------------^^^^------------------ help: consider using a semicolon here
6    |     |                    |
7    |     |                    expected `()`, found `bool`
8    |     expected this to be `()`
9
10 error[E0308]: mismatched types
11   --> $DIR/expr-as-stmt-2.rs:3:40
12    |
13 LL |     if let Some(x) = a { true } else { false }
14    |     -----------------------------------^^^^^--- help: consider using a semicolon here
15    |     |                                  |
16    |     |                                  expected `()`, found `bool`
17    |     expected this to be `()`
18
19 error[E0308]: mismatched types
20   --> $DIR/expr-as-stmt-2.rs:6:5
21    |
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 })`
26 ...
27 LL | /     &&
28 LL | |     if let Some(y) = a { true } else { false }
29    | |______________________________________________^ expected `bool`, found `&&bool`
30
31 error: aborting due to 3 previous errors
32
33 For more information about this error, try `rustc --explain E0308`.