Navigation
Recherche
|
Rust 1.84 introduces strict provenance APIs
vendredi 10 janvier 2025, 00:30 , par InfoWorld
Rust 1.84 has been released, bringing strict provenance APIs that can be used in lieu of integer-pointer casts, making the code both easier for developers to reason about and easier for the compiler to analyze, the Rust team said.
Announced January 9, Rust 1.84 can be installed via rustup for those who have a previous version installed, using the command rustup update stable. The new strict provenance APIs can in many cases replace the use of integer-pointer casts, thereby avoiding ambiguities inherent in such casts. In particular, the pattern of using the lowest bits of an aligned pointer to store extra information now can be implemented without casting a pointer to an integer or back. Rust 1.84 stabilizes the minimum supported Rust version (MSRV) aware resolver, which prefers dependency versions compatible with the project’s declared MSRV. Through MSRV-aware version selection, the toil is reduced for maintainers to support older toolchains by not having to manually select older versions for each dependency. Developers can opt-in to the MSRV-aware resolver via.cargo/config.toml. Also in Rust 1.84, the Rust compiler is in the process of moving to a new implementation for the trait solver. The next-generation trait solver is a reimplementation of a core component of Rust’s type system and responsible for checking whether trait-bounds hold, the Rust team said. It also is used by other parts of the type system, such as normalization and equating types. With version 1.84, 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 fixes some theoretical correctness issues of the old implementation. Rust 1.84 also stabilizes more than a dozen APIs. Rust 1.84 follows the late-November release of Rust 1.83, which expanded capabilities for code running in const contexts.
https://www.infoworld.com/article/3732079/rust-1-84-introduces-strict-provenance-apis.html
Voir aussi |
56 sources (32 en français)
Date Actuelle
ven. 10 janv. - 14:45 CET
|