From 96fb8a750b611edec1dd10607c53b2f8e35b4851 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 9 May 2024 12:52:38 +0200 Subject: [PATCH] offset_from intrinsic: always allow pointers to point to the same address --- tests/pass/zero-sized-accesses-and-offsets.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/pass/zero-sized-accesses-and-offsets.rs b/tests/pass/zero-sized-accesses-and-offsets.rs index 2d142bef73..a3356b682a 100644 --- a/tests/pass/zero-sized-accesses-and-offsets.rs +++ b/tests/pass/zero-sized-accesses-and-offsets.rs @@ -39,8 +39,6 @@ fn test_ptr(ptr: *mut ()) { // Distance. let ptr = ptr.cast::(); ptr.offset_from(ptr); - /* - FIXME: this is disabled for now as these cases are not yet allowed. // Distance from other "bad" pointers that have the same address, but different provenance. Some // of this is library UB, but we don't want it to be language UB since that would violate // provenance monotonicity: if we allow computing the distance between two ptrs with no @@ -54,6 +52,5 @@ fn test_ptr(ptr: *mut ()) { // - Distance from use-after-free pointer drop(b); ptr.offset_from(other_ptr.with_addr(ptr.addr())); - */ } }