]>
Commit | Line | Data |
---|---|---|
7cac9316 | 1 | error[E0308]: mismatched types |
0731742a | 2 | --> $DIR/coercion-missing-tail-expected-type.rs:3:24 |
7cac9316 | 3 | | |
532ac7d7 | 4 | LL | fn plus_one(x: i32) -> i32 { |
60c5eb7d | 5 | | -------- ^^^ expected `i32`, found `()` |
0731742a | 6 | | | |
416331ca | 7 | | implicitly returns `()` as its body has no tail or `return` expression |
0731742a XL |
8 | LL | x + 1; |
9 | | - help: consider removing this semicolon | |
041b39d2 XL |
10 | |
11 | error[E0308]: mismatched types | |
0731742a | 12 | --> $DIR/coercion-missing-tail-expected-type.rs:7:13 |
7cac9316 | 13 | | |
532ac7d7 | 14 | LL | fn foo() -> Result<u8, u64> { |
60c5eb7d | 15 | | --- ^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found `()` |
0731742a | 16 | | | |
416331ca | 17 | | implicitly returns `()` as its body has no tail or `return` expression |
0731742a XL |
18 | LL | Ok(1); |
19 | | - help: consider removing this semicolon | |
041b39d2 | 20 | | |
60c5eb7d XL |
21 | = note: expected enum `std::result::Result<u8, u64>` |
22 | found unit type `()` | |
7cac9316 | 23 | |
041b39d2 | 24 | error: aborting due to 2 previous errors |
7cac9316 | 25 | |
0531ce1d | 26 | For more information about this error, try `rustc --explain E0308`. |