From 045175d3fd6b48ad30397fc9018d717afed6ade4 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sun, 12 Jul 2026 12:59:59 +0900 Subject: [PATCH] c-variadic: Update cfg for 128-bit integers to fix build error on AArch64 ILP32 --- library/core/src/ffi/va_list.rs | 37 ++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/library/core/src/ffi/va_list.rs b/library/core/src/ffi/va_list.rs index e27f581c04ca2..cf70e6b3f3177 100644 --- a/library/core/src/ffi/va_list.rs +++ b/library/core/src/ffi/va_list.rs @@ -371,25 +371,28 @@ unsafe impl VaArgSafe for usize {} // does provide `__int128` on 64-bit `*-pc-windows-msvc`, and we follow suit. cfg_select! { any( - target_arch = "aarch64", - target_arch = "amdgpu", - target_arch = "arm64ec", - target_arch = "bpf", - target_arch = "loongarch64", - target_arch = "mips64", - target_arch = "mips64r6", - target_arch = "nvptx64", - target_arch = "powerpc64", - target_arch = "riscv64", - target_arch = "s390x", - target_arch = "sparc64", target_arch = "wasm32", - target_arch = "wasm64", - target_arch = "x86_64", + all(target_arch = "x86_64", target_abi = "x32"), + all( + target_pointer_width = "64", + any( + target_arch = "aarch64", + target_arch = "amdgpu", + target_arch = "arm64ec", + target_arch = "bpf", + target_arch = "loongarch64", + target_arch = "mips64", + target_arch = "mips64r6", + target_arch = "nvptx64", + target_arch = "powerpc64", + target_arch = "riscv64", + target_arch = "s390x", + target_arch = "sparc64", + target_arch = "wasm64", + target_arch = "x86_64", + ), + ), ) => { - #[cfg(not(any(target_arch = "wasm32", target_abi = "x32", target_pointer_width = "64")))] - compile_error!("unexpected target architecture for 128-bit c-variadic"); - #[unstable_feature_bound(c_variadic_int128)] #[unstable(feature = "c_variadic_int128", issue = "155752")] unsafe impl VaArgSafe for i128 {}