diff options
Diffstat (limited to 'tests/ui/coercion/coercion-missing-tail-expected-type.rs')
-rw-r--r-- | tests/ui/coercion/coercion-missing-tail-expected-type.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/coercion/coercion-missing-tail-expected-type.rs b/tests/ui/coercion/coercion-missing-tail-expected-type.rs new file mode 100644 index 000000000..e14d79d8a --- /dev/null +++ b/tests/ui/coercion/coercion-missing-tail-expected-type.rs @@ -0,0 +1,16 @@ +// #41425 -- error message "mismatched types" has wrong types +// run-rustfix + +fn plus_one(x: i32) -> i32 { //~ ERROR mismatched types + x + 1; +} + +fn foo() -> Result<u8, u64> { //~ ERROR mismatched types + Ok(1); +} + +fn main() { + let x = plus_one(5); + let _ = foo(); + println!("X = {}", x); +} |