mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 02:33:55 +00:00
18 lines
333 B
Rust
18 lines
333 B
Rust
#![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
|
|
}
|