From fae24b6da64aa39e4fe15e537114f5aab392dadd Mon Sep 17 00:00:00 2001 From: WillLillis Date: Wed, 26 Mar 2025 01:43:13 -0400 Subject: [PATCH] fix(rust): address new nightly lint for pointer comparisons (cherry picked from commit 521da2b0a7e8815efbcf1e4b98e5ac16113c5763) --- cli/src/fuzz/allocations.rs | 2 +- cli/src/tests/helpers/allocations.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/fuzz/allocations.rs b/cli/src/fuzz/allocations.rs index fed446c6..9d7c91ab 100644 --- a/cli/src/fuzz/allocations.rs +++ b/cli/src/fuzz/allocations.rs @@ -109,7 +109,7 @@ unsafe extern "C" fn ts_record_realloc(ptr: *mut c_void, size: usize) -> *mut c_ let result = realloc(ptr, size); if ptr.is_null() { record_alloc(result); - } else if ptr != result { + } else if !core::ptr::eq(ptr, result) { record_dealloc(ptr); record_alloc(result); } diff --git a/cli/src/tests/helpers/allocations.rs b/cli/src/tests/helpers/allocations.rs index 103cb092..dec67b11 100644 --- a/cli/src/tests/helpers/allocations.rs +++ b/cli/src/tests/helpers/allocations.rs @@ -108,7 +108,7 @@ unsafe extern "C" fn ts_record_realloc(ptr: *mut c_void, size: usize) -> *mut c_ let result = realloc(ptr, size); if ptr.is_null() { record_alloc(result); - } else if ptr != result { + } else if !core::ptr::eq(ptr, result) { record_dealloc(ptr); record_alloc(result); }