]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coercion/coercion-missing-tail-expected-type.stderr
Auto merge of #102458 - JohnTitor:stabilize-instruction-set, r=oli-obk
[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:4: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: remove this semicolon to return this value
10
11 error[E0308]: mismatched types
12   --> $DIR/coercion-missing-tail-expected-type.rs:8:13
13    |
14 LL | fn foo() -> Result<u8, u64> {
15    |    ---      ^^^^^^^^^^^^^^^ expected enum `Result`, found `()`
16    |    |
17    |    implicitly returns `()` as its body has no tail or `return` expression
18 LL |     Ok(1);
19    |          - help: remove this semicolon to return this value
20    |
21    = note:   expected enum `Result<u8, u64>`
22            found unit type `()`
23
24 error: aborting due to 2 previous errors
25
26 For more information about this error, try `rustc --explain E0308`.