The Rust team has announced the release of Rust 1.84, bringing a slew of new features and improvements to the programming language. The latest version introduces strict provenance APIs, which can replace integer-pointer casts, making it easier for developers to reason about their code and for the compiler to analyze it.
The strict provenance APIs are designed to avoid ambiguities inherent in integer-pointer casts. This means that developers can now implement patterns that use the lowest bits of an aligned pointer to store extra information without casting a pointer to an integer or back. This change is expected to improve the overall reliability and maintainability of Rust code.
In addition to the new APIs, Rust 1.84 also stabilizes the minimum supported Rust version (MSRV) aware resolver. This feature allows developers to opt-in to a resolver that prefers dependency versions compatible with the project's declared MSRV. This change reduces the toil for maintainers to support older toolchains, as they no longer need to manually select older versions for each dependency.
The Rust compiler is also undergoing a significant change with the introduction of a next-generation trait solver. This new solver is a reimplementation of a core component of Rust's type system, responsible for checking whether trait-bounds hold. The new solver is used for checking coherence of trait impls, ensuring there is at most one implementation of a trait for a given type. This change fixes some theoretical correctness issues of the old implementation.
Rust 1.84 also stabilizes more than a dozen APIs, further expanding the capabilities of the language. This release follows the late-November release of Rust 1.83, which expanded capabilities for code running in const contexts.
The Rust team has made it easy for developers to get started with the new version, as Rust 1.84 can be installed via rustup for those who have a previous version installed, using the command rustup update stable.
Overall, Rust 1.84 is a significant release that demonstrates the language's commitment to improving developer experience and reliability. With its new strict provenance APIs, improved compiler, and enhanced developer tools, Rust continues to solidify its position as a leading programming language for systems programming and beyond.