diff options
Diffstat (limited to 'src/test/ui/numeric/numeric-cast-2.rs')
-rw-r--r-- | src/test/ui/numeric/numeric-cast-2.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/numeric/numeric-cast-2.rs b/src/test/ui/numeric/numeric-cast-2.rs new file mode 100644 index 000000000..ad2de5d2b --- /dev/null +++ b/src/test/ui/numeric/numeric-cast-2.rs @@ -0,0 +1,11 @@ +fn foo() -> i32 { + 4 +} +fn main() { + let x: u16 = foo(); + //~^ ERROR mismatched types + let y: i64 = x + x; + //~^ ERROR mismatched types + let z: i32 = x + x; + //~^ ERROR mismatched types +} |