Rust 1.99 lets you write C-style variadic functions in Rust itself. Those are functions that take a variable number of arguments, like C's printf. The Rust release team shipped it on 1 October, and it's the first stable release where you can define one, not just call one.
Quin Halberg · Saturday 3 October 2026
Step by step
- Update Rust
Run rustup update stable, then check that rustc --version shows 1.99.0.
- Create a library
Run cargo new --lib varsum and set crate-type = ["staticlib", "rlib"] in Cargo.toml, using the 2024 edition.
- Write the function
Define a pub unsafe extern "C" function with #[unsafe(no_mangle)] and a named ... parameter, and read each argument with next_arg using C types such as c_long.
- Test it
Add a unit test and run cargo test.
- Call it from C
Build with cargo build --release, declare the function in C and link against target/release/libvarsum.a.
- Follow the safety rules
Keep the function unsafe, only read VaArgSafe types, and read c_double rather than f32.
Sources
This desk has not corrected this file. Corrections.






The paper
Comments
No notes on this story yet.
Sign in to comment