rust/tests/ui/issue_3849.rs
2019-03-07 23:26:47 +09:00

14 lines
305 B
Rust

#![allow(dead_code)]
#![allow(clippy::zero_ptr)]
#![allow(clippy::transmute_ptr_to_ref)]
pub const ZPTR: *const usize = 0 as *const _;
fn main() {
unsafe {
#[clippy::author]
let _: &i32 = std::mem::transmute(ZPTR);
let _: &i32 = std::mem::transmute(0 as *const i32);
}
}