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
This commit is contained in:
Folkert de Vries
2026-04-26 14:00:51 +02:00
parent eb8f85e7f4
commit ab19cd3dea
+1 -1
View File
@@ -333,7 +333,7 @@ impl<T> 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") => {