rust/tests/ui/zero_offset.rs

13 lines
215 B
Rust
Raw Normal View History

2019-11-14 19:18:24 +00:00
fn main() {
unsafe {
let x = &() as *const ();
x.offset(0);
x.wrapping_add(0);
x.sub(0);
x.wrapping_sub(0);
let y = &1 as *const u8;
y.offset(0);
}
}