Rust 1.77 released with C-string literals support, stabilized offset_of! and more
The Rust team has announced the release of Rust 1.77, a new version of the programming language designed to help developers create reliable and efficient software. This update, while relatively minor, continues to build upon the language's robust foundation through incremental improvements.
One of the key updates in Rust 1.77 is the support for C-string literals (c"abc"). These expand to a nul-byte terminated string in memory of type &'static CStr, simplifying code interoperability with foreign language interfaces that require nul-terminated strings. This update also ensures relevant error checking is performed at compile time.
In previous versions, async functions couldn't call themselves due to a compiler limitation. This restriction has been removed in Rust 1.77, allowing recursive calls as long as they use some form of indirection to avoid an infinite size for the function's state.
Rust 1.77 also stabilizes offset_of! for struct fields. This provides access to the byte offset of the relevant public field of a struct, proving particularly useful when the offset of a field is required without an existing instance of a type.
The new version has enabled strip in release profiles by default. Additionally, Clippy, Rust's collection of lints to catch common mistakes and improve code, has added a new incompatible_msrv lint in Rust 1.77.
Alongside these updates, Rust 1.77 comes with other improvements and stabilized APIs, reinforcing its commitment to providing a reliable and efficient platform for software development.