]> git.lizzy.rs Git - rust.git/blob - tests/compile-fail/cast_int_to_fn_ptr.rs
Merge pull request #200 from oli-obk/master
[rust.git] / tests / compile-fail / cast_int_to_fn_ptr.rs
1 fn main() {
2     let g = unsafe {
3         std::mem::transmute::<usize, fn(i32)>(42)
4     };
5
6     g(42) //~ ERROR a memory access tried to interpret some bytes as a pointer
7 }