rust/tests/fail/intrinsics/ptr_offset_int_plus_int.rs
2022-06-01 10:53:38 -04:00

9 lines
179 B
Rust

// error-pattern: is not a valid pointer
fn main() {
// Can't offset an integer pointer by non-zero offset.
unsafe {
let _val = (1 as *mut u8).offset(1);
}
}