blob: eb4683e2c3088ac5979e2f687998e3048bed2d55 (
plain)
1
2
3
4
5
6
7
8
|
// 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() {}
|