mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 01:34:21 +00:00
9 lines
211 B
Rust
9 lines
211 B
Rust
|
// check-pass
|
||
|
|
||
|
use std::ptr::NonNull;
|
||
|
|
||
|
const NON_NULL: NonNull<u8> = unsafe { NonNull::new_unchecked((&42u8 as *const u8).cast_mut()) };
|
||
|
const _: () = assert!(42 == *unsafe { NON_NULL.as_ref() });
|
||
|
|
||
|
fn main() {}
|