]> git.lizzy.rs Git - rust.git/blob - tests/ui/transmute_32bit.rs
rustup and compile-fail -> ui test move
[rust.git] / tests / ui / transmute_32bit.rs
1 //ignore-x86_64
2 #![feature(plugin)]
3 #![plugin(clippy)]
4
5 #[deny(wrong_transmute)]
6 fn main() {
7     unsafe {
8         let _: *const usize = std::mem::transmute(6.0f32);
9         //~^ ERROR transmute from a `f32` to a pointer
10
11         let _: *mut usize = std::mem::transmute(6.0f32);
12         //~^ ERROR transmute from a `f32` to a pointer
13
14         let _: *const usize = std::mem::transmute('x');
15         //~^ ERROR transmute from a `char` to a pointer
16
17         let _: *mut usize = std::mem::transmute('x');
18         //~^ ERROR transmute from a `char` to a pointer
19     }
20 }