rust/tests/ui/numeric/numeric-cast-2.rs

12 lines
208 B
Rust
Raw Normal View History

2018-01-06 23:10:51 -06:00
fn foo() -> i32 {
4
}
fn main() {
let x: u16 = foo();
//~^ ERROR mismatched types
let y: i64 = x + x;
2018-01-07 14:27:03 -06:00
//~^ ERROR mismatched types
2018-01-06 23:10:51 -06:00
let z: i32 = x + x;
2018-01-07 14:27:03 -06:00
//~^ ERROR mismatched types
2018-01-06 23:10:51 -06:00
}