mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 01:28:18 +03:00
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:
@@ -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") => {
|
||||
|
||||
Reference in New Issue
Block a user