From ef24de24a82fe681581cc130f342363c47c0969a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 7 Jun 2024 07:48:48 +0200 Subject: Merging upstream version 1.75.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/portable-atomic/src/gen/utils.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'vendor/portable-atomic/src/gen/utils.rs') diff --git a/vendor/portable-atomic/src/gen/utils.rs b/vendor/portable-atomic/src/gen/utils.rs index 1067e8821..61f6c99bf 100644 --- a/vendor/portable-atomic/src/gen/utils.rs +++ b/vendor/portable-atomic/src/gen/utils.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 OR MIT // This file is @generated by target_spec.sh. // It is not intended for manual editing. @@ -45,7 +46,20 @@ macro_rules! ptr_reg { ($ptr:ident) => {{ let _: *const _ = $ptr; // ensure $ptr is a pointer (*mut _ or *const _) - $ptr as u64 + #[cfg(not(portable_atomic_no_asm_maybe_uninit))] + #[allow(clippy::ptr_as_ptr)] + { + // If we cast to u64 here, the provenance will be lost, + // so we convert to MaybeUninit via zero extend helper. + crate::utils::zero_extend64_ptr($ptr as *mut ()) + } + #[cfg(portable_atomic_no_asm_maybe_uninit)] + { + // Use cast on old rustc because it does not support MaybeUninit + // registers. This is still permissive-provenance compatible and + // is sound. + $ptr as u64 + } }}; } #[cfg(not(all( -- cgit v1.2.3