mirror of https://github.com/rust-lang/rust
11 lines
377 B
Rust
11 lines
377 B
Rust
//@ run-rustfix
|
|
|
|
fn main() {
|
|
let _ptr1: *const u32 = std::ptr::null();
|
|
let _ptr2: *const u32 = std::ptr::null();
|
|
let _a = _ptr1.wrapping_add(5); //~ ERROR cannot add
|
|
let _b = _ptr1.wrapping_sub(5); //~ ERROR cannot subtract
|
|
let _c = unsafe { _ptr2.offset_from(_ptr1) }; //~ ERROR cannot subtract
|
|
let _d = _ptr1.wrapping_add(5); //~ ERROR cannot index
|
|
}
|