rust/library/std/src/ffi
Matthias Krüger b9c6b337ce
Rollup merge of #141341 - folkertdev:limit-VaArgSafe-impls, r=workingjubilee
limit impls of `VaArgSafe` to just types that are actually safe

tracking issue: https://github.com/rust-lang/rust/issues/44930

Retrieving 8- or 16-bit integer arguments from a `VaList` is not safe, because such types are subject to upcasting. See https://github.com/rust-lang/rust/issues/61275#issuecomment-2193942535 for more detail.

This PR also makes the instances of `VaArgSafe` visible in the documentation, and uses a private sealed trait to make sure users cannot create additional impls of `VaArgSafe`, which would almost certainly cause UB.

r? `@workingjubilee`
2025-05-21 22:14:58 +02:00
..
os_str Add inherent versions of MaybeUninit methods for slices 2025-01-11 23:57:00 -05:00
c_str.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
mod.rs limit impls of VaArgSafe to just types that are actually safe 2025-05-21 15:36:29 +02:00
os_str.rs use Self alias in self types rather than manually substituting it 2025-05-20 16:03:04 +02:00