Rust 1.80 released with LazyCell and LazyLock, enhanced Cargo checks & exclusive endpoints
The Rust team has unveiled Rust 1.80, bringing new enhancements to aid in the development of reliable and efficient software. Key features in this release include LazyCell and LazyLock, which defer data initialization until first access, expanding on the OnceCell and OnceLock types introduced in Rust 1.70 by incorporating the initialization function directly within the cell.
Additionally, Cargo 1.80 now enables comprehensive checks for all cfg names and values recognized by rustc, including feature names from Cargo.toml and new cargo::rustc-check-cfg outputs from build scripts. This builds upon the --check-cfg flag stabilized in Rust 1.79.
Rust 1.80 also introduces the use of exclusive endpoints in ranged patterns, formatted as a..b or ..b, aligning with the Range and RangeTo expression types. The release includes several stabilized APIs, alongside various other changes and bug fixes, to improve the overall development experience.