diff options
Diffstat (limited to 'src/test/ui/typeck/typeck-cast-pointer-to-float.rs')
-rw-r--r-- | src/test/ui/typeck/typeck-cast-pointer-to-float.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test/ui/typeck/typeck-cast-pointer-to-float.rs b/src/test/ui/typeck/typeck-cast-pointer-to-float.rs new file mode 100644 index 000000000..2af7a3cf2 --- /dev/null +++ b/src/test/ui/typeck/typeck-cast-pointer-to-float.rs @@ -0,0 +1,5 @@ +fn main() { + let x : i16 = 22; + ((&x) as *const i16) as f32; + //~^ ERROR casting `*const i16` as `f32` is invalid +} |