Rollup merge of #42731 - MaloJaffre:issue-24889, r=Mark-Simulacrum

Add test for #24889

Fixes #24889.
r? @Mark-Simulacrum (Thanks for the instructions).
This commit is contained in:
Mark Simulacrum 2017-06-18 10:34:13 -06:00 committed by GitHub
commit db9c12c2ef
2 changed files with 21 additions and 0 deletions

View file

@ -14,6 +14,10 @@ fn plus_one(x: i32) -> i32 {
x + 1;
}
fn foo() -> Result<u8, u64> {
Ok(1);
}
fn main() {
let x = plus_one(5);
println!("X = {}", x);

View file

@ -15,5 +15,22 @@ help: consider removing this semicolon:
14 | x + 1;
| ^
error[E0308]: mismatched types
--> $DIR/coercion-missing-tail-expected-type.rs:17:29
|
17 | fn foo() -> Result<u8, u64> {
| _____________________________^
18 | | Ok(1);
19 | | }
| |_^ expected enum `std::result::Result`, found ()
|
= note: expected type `std::result::Result<u8, u64>`
found type `()`
help: consider removing this semicolon:
--> $DIR/coercion-missing-tail-expected-type.rs:18:10
|
18 | Ok(1);
| ^
error: aborting due to previous error(s)