mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-02 21:17:39 +00:00
15 lines
274 B
Rust
15 lines
274 B
Rust
![]() |
// Make sure that we don't insert a check for `addr_of!`.
|
||
|
//@ run-pass
|
||
|
//@ compile-flags: -C debug-assertions
|
||
|
|
||
|
struct Field {
|
||
|
a: u32,
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
unsafe {
|
||
|
let ptr: *const Field = std::ptr::null();
|
||
|
let _ptr = core::ptr::addr_of!((*ptr).a);
|
||
|
}
|
||
|
}
|