]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coercion/coercion-missing-tail-expected-type.rs
Rollup merge of #103729 - RalfJung:align-of-val-packed, r=oli-obk
[rust.git] / src / test / ui / coercion / coercion-missing-tail-expected-type.rs
1 // #41425 -- error message "mismatched types" has wrong types
2 // run-rustfix
3
4 fn plus_one(x: i32) -> i32 { //~ ERROR mismatched types
5     x + 1;
6 }
7
8 fn foo() -> Result<u8, u64> { //~ ERROR mismatched types
9     Ok(1);
10 }
11
12 fn main() {
13     let x = plus_one(5);
14     let _ = foo();
15     println!("X = {}", x);
16 }