]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coercion/coercion-missing-tail-expected-type.stderr
1122901a17eda8ec8a2e48905ee8f8f4682d97dd
[rust.git] / src / test / ui / coercion / coercion-missing-tail-expected-type.stderr
1 error[E0308]: mismatched types
2   --> $DIR/coercion-missing-tail-expected-type.rs:3:24
3    |
4 LL | fn plus_one(x: i32) -> i32 {
5    |    --------            ^^^ expected i32, found ()
6    |    |
7    |    implicitly returns `()` as its body has no tail or `return` expression
8 LL |     x + 1;
9    |          - help: consider removing this semicolon
10    |
11    = note:   expected type `i32`
12            found unit type `()`
13
14 error[E0308]: mismatched types
15   --> $DIR/coercion-missing-tail-expected-type.rs:7:13
16    |
17 LL | fn foo() -> Result<u8, u64> {
18    |    ---      ^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found ()
19    |    |
20    |    implicitly returns `()` as its body has no tail or `return` expression
21 LL |     Ok(1);
22    |          - help: consider removing this semicolon
23    |
24    = note:   expected enum `std::result::Result<u8, u64>`
25            found unit type `()`
26
27 error: aborting due to 2 previous errors
28
29 For more information about this error, try `rustc --explain E0308`.