Skip to content

Commit 96fb8a7

Browse files
committed
offset_from intrinsic: always allow pointers to point to the same address
1 parent 725c9a6 commit 96fb8a7

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

tests/pass/zero-sized-accesses-and-offsets.rs

-3
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ fn test_ptr(ptr: *mut ()) {
3939
// Distance.
4040
let ptr = ptr.cast::<i32>();
4141
ptr.offset_from(ptr);
42-
/*
43-
FIXME: this is disabled for now as these cases are not yet allowed.
4442
// Distance from other "bad" pointers that have the same address, but different provenance. Some
4543
// of this is library UB, but we don't want it to be language UB since that would violate
4644
// provenance monotonicity: if we allow computing the distance between two ptrs with no
@@ -54,6 +52,5 @@ fn test_ptr(ptr: *mut ()) {
5452
// - Distance from use-after-free pointer
5553
drop(b);
5654
ptr.offset_from(other_ptr.with_addr(ptr.addr()));
57-
*/
5855
}
5956
}

0 commit comments

Comments
 (0)