this post was submitted on 19 Jan 2026
2 points (55.6% liked)
Rust
7695 readers
4 users here now
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
printfuses macros in its implementation.^ This is from glibc. Do you know what
va_startandva_endare?Derives expand to "regular code". You can run
cargo expandto see it. And I'm not sure how that's an indication of "bare bone"-ness in any case.Such derives are actually using a cool trick, which is the fact that proc macros and traits have separate namespaces. so
#[derive(Debug)]is using the proc macro namedDebugwhich happens to generate "regular code" that implements theDebugtrait. The proc macro namedDebugand implemented traitDebugdon't point to the same thing, and don't have to match name-wise.Does anyone? 🙃
For functions that want to accept variadic arguments in C/Cpp
Yup; I was referring to their implementation being dark magic, depending on calling convention, argument type, argument order and possibly other properties specific to the processor’s instruction set…
“If you think you understand
va_*, you don’t.”Yeah, didn't catch your sarcasm there :D
I was just referring to the fact that they are macros.