]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coercion-missing-tail-expected-type.stderr
Auto merge of #42614 - GuillaumeGomez:new-error-codes, r=pnkfelix
[rust.git] / src / test / ui / coercion-missing-tail-expected-type.stderr
1 error[E0308]: mismatched types
2   --> $DIR/coercion-missing-tail-expected-type.rs:13:28
3    |
4 13 |   fn plus_one(x: i32) -> i32 {
5    |  ____________________________^
6 14 | |     x + 1;
7 15 | | }
8    | |_^ expected i32, found ()
9    |
10    = note: expected type `i32`
11               found type `()`
12 help: consider removing this semicolon:
13   --> $DIR/coercion-missing-tail-expected-type.rs:14:10
14    |
15 14 |     x + 1;
16    |          ^
17
18 error[E0308]: mismatched types
19   --> $DIR/coercion-missing-tail-expected-type.rs:17:29
20    |
21 17 |   fn foo() -> Result<u8, u64> {
22    |  _____________________________^
23 18 | |     Ok(1);
24 19 | | }
25    | |_^ expected enum `std::result::Result`, found ()
26    |
27    = note: expected type `std::result::Result<u8, u64>`
28               found type `()`
29 help: consider removing this semicolon:
30   --> $DIR/coercion-missing-tail-expected-type.rs:18:10
31    |
32 18 |     Ok(1);
33    |          ^
34
35 error: aborting due to previous error(s)
36