From ab19cd3dea151cf070d504c605c618c1d05b91e9 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Sun, 26 Apr 2026 14:00:51 +0200 Subject: [PATCH] c-variadic: add a `Copy` bound to `VaArgSafe` because a VaList can be cloned, the same c-variadic argument can be read twice and that is only safe if the argument type is copy --- library/core/src/ffi/va_list.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/ffi/va_list.rs b/library/core/src/ffi/va_list.rs index fe6fae478957..afd166d4931e 100644 --- a/library/core/src/ffi/va_list.rs +++ b/library/core/src/ffi/va_list.rs @@ -333,7 +333,7 @@ impl Sealed for *const T {} // types with an alignment larger than 8, or with a non-scalar layout. Inline assembly can be used // to accept unsupported types in the meantime. #[lang = "va_arg_safe"] -pub unsafe trait VaArgSafe: sealed::Sealed {} +pub unsafe trait VaArgSafe: Copy + sealed::Sealed {} crate::cfg_select! { any(target_arch = "avr", target_arch = "msp430") => {