about summary refs log tree commit diff
path: root/tests/ui/expr/if/if-else-chain-missing-else.stderr
blob: 6c437120d391da06eb95bf9182f128b7778fdc2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
error[E0308]: `if` and `else` have incompatible types
  --> $DIR/if-else-chain-missing-else.rs:12:12
   |
LL |       let x = if let Ok(x) = res {
   |               ------------------ `if` and `else` have incompatible types
LL |           x
   |           - expected because of this
LL |       } else if let Err(e) = res {
   |  ____________^
LL | |         return Err(e);
LL | |     };
   | |_____^ expected `i32`, found `()`
   |
   = note: `if` expressions without `else` evaluate to `()`
   = note: consider adding an `else` block that evaluates to the expected type

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0308`.