about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/author/issue_3849.rs
blob: dbd63b21af296989e49c298ccc3166fc96386f1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//@ check-pass

#![allow(dead_code)]
#![allow(clippy::zero_ptr)]
#![allow(clippy::transmute_ptr_to_ref)]
#![allow(clippy::transmuting_null, clippy::missing_transmute_annotations)]

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);
    }
}