]> git.proxmox.com Git - rustc.git/blame - src/test/ui/coercion/coercion-missing-tail-expected-type.stderr
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / coercion / coercion-missing-tail-expected-type.stderr
CommitLineData
7cac9316 1error[E0308]: mismatched types
0731742a 2 --> $DIR/coercion-missing-tail-expected-type.rs:3:24
7cac9316 3 |
532ac7d7 4LL | 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
8LL | x + 1;
9 | - help: consider removing this semicolon
041b39d2
XL
10
11error[E0308]: mismatched types
0731742a 12 --> $DIR/coercion-missing-tail-expected-type.rs:7:13
7cac9316 13 |
532ac7d7 14LL | 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
18LL | 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 24error: aborting due to 2 previous errors
7cac9316 25
0531ce1d 26For more information about this error, try `rustc --explain E0308`.