rust/tests/compile-fail/intrinsics/write_bytes_null.rs
2020-05-01 14:43:59 +02:00

11 lines
311 B
Rust

#![feature(intrinsics)]
// Directly call intrinsic to avoid debug assertions in libstd
extern "rust-intrinsic" {
fn write_bytes<T>(dst: *mut T, val: u8, count: usize);
}
fn main() {
unsafe { write_bytes::<u8>(std::ptr::null_mut(), 0, 0) }; //~ ERROR memory access failed: 0x0 is not a valid pointer
}