Skip to content

Conversation

folkertdev
Copy link
Contributor

tracking issue: #44930

We concluded that this trait should be implementable by end users. Many ABIs do support passing additional types (128-bit integers, SIMD vectors, composite types).

r? @workingjubilee

And update the safety documentation
@folkertdev folkertdev added the F-c_variadic `#![feature(c_variadic)]` label Sep 11, 2025
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 11, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 11, 2025

workingjubilee is currently at their maximum review capacity.
They may take a while to respond.

Comment on lines -209 to +192
/// This trait must only be implemented for types that C passes as varargs without implicit promotion.
/// Implementing this trait asserts that the type can be soundly passed via varargs.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestions are welcome. VaList::arg is still also unsafe, so really what this trait does is disallow a couple of cases that will clearly not work, and make users explicitly opt-in to anything more exotic than fundamental types that have direct equivalents in (older) C.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-c_variadic `#![feature(c_variadic)]` S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants