Rust 1.99.0 now supports defining C-ABI variadic functions using "C" and "C-unwind" ABIs. This allows Rust functions to accept a variable number of arguments, similar to C's `va_list` type. Previously, Rust could only call externally defined variadic functions, but now developers can implement them directly in Rust.
The `VaList` type, which is ABI-compatible with C's `va_list`, is used for these functions. The `VaArgSafe` trait guards which types can be read from a `VaList`. This release also stabilizes support for defining naked variadic functions with non-"C" ABIs via inline assembly.
The release clarifies the safety requirements for retrieving size and alignment information from raw pointers for both `Sized` and non-`Sized` types. This is achieved by stabilizing three specific functions. This change provides more consistent and safer ways to handle memory layout when working with raw pointers.
While no language semantics changed for `Box::leak`, its documentation has been updated. The new guidance recommends against patterns that deallocate memory after using `Box::leak`. This recommendation addresses problematic interactions with current and future compiler optimizations, especially with the upcoming stabilization of custom allocators.
Developers are now advised to prefer `Box::into_non_null` over `Box::leak` for scenarios where deallocation might occur, as `Box::into_non_null` is designed for such use cases without the potential issues associated with `Box::leak`.
✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →
One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.
One email a day. Unsubscribe in one click, any time.
Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.
▶ Play today's briefNew every morning, and the back catalogue is archived by date.
Rust 1.99.0 has been released, introducing stable support for defining C-ABI variadic functions and clarifying safety requirements for retrieving layout information from raw pointers. These updates allow Rust developers to write C-compatible variadic functions directly in Rust and provide clearer guidelines for memory management with raw pointers.