summaryrefslogtreecommitdiffstats
path: root/src/test/ui/lint/lint-forbid-internal-unsafe.rs
blob: 3ee55ba96b1378746cd26726d543a88b08108b40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#![forbid(unsafe_code)]
#![feature(allow_internal_unsafe)]

#[allow_internal_unsafe]
//~^ ERROR: `allow_internal_unsafe` allows defining
macro_rules! evil {
    ($e:expr) => {
        unsafe {
            $e
        }
    }
}

fn main() {
    println!("{}", evil!(*(0 as *const u8)));
    //~^ WARNING dereferencing a null pointer
}