We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8af675a commit 3281e62Copy full SHA for 3281e62
src/libcore/tests/ptr.rs
@@ -40,18 +40,17 @@ fn test() {
40
}
41
42
#[test]
43
-#[cfg(not(miri))] // This test performs invalid OOB pointer arithmetic
44
fn test_is_null() {
45
let p: *const isize = null();
46
assert!(p.is_null());
47
48
- let q = unsafe { p.offset(1) };
+ let q = p.wrapping_offset(1);
49
assert!(!q.is_null());
50
51
let mp: *mut isize = null_mut();
52
assert!(mp.is_null());
53
54
- let mq = unsafe { mp.offset(1) };
+ let mq = mp.wrapping_offset(1);
55
assert!(!mq.is_null());
56
57
// Pointers to unsized types -- slices
0 commit comments