rust/tests/ui/unsafe/place-expr-safe.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
292 B
Rust
Raw Normal View History

2024-08-17 12:03:27 -05:00
//@ check-pass
fn main() {
let ptr = std::ptr::null_mut::<i32>();
let addr = &raw const *ptr;
let local = 1;
let ptr = &local as *const i32;
let addr = &raw const *ptr;
let boxed = Box::new(1);
let ptr = &*boxed as *const i32;
let addr = &raw const *ptr;
}