Rust 1.95 Released with New Match Guards and Stable API Additions

Rust 1.95 is out with language improvements, expanded match capabilities, and new stable APIs across core library components.

Rust 1.95 has been released, with support for if let guards within match expressions. This feature builds on the let chain functionality introduced in Rust 1.88, enabling additional conditional pattern checks directly in match arms.

The Rust team notes that patterns matched in if let guards are not currently included in the compiler’s match exhaustiveness evaluation, similar to ordinary if guards.

Another worth mentioning update is the introduction of the cfg_select! macro. The Rust release team explains that it functions as a compile-time match over configuration predicates, serving a similar purpose to the widely used cfg-if crate but with different syntax. This macro enables developers to select implementations or values based on target platform or build configuration more directly.

On top of that, Rust 1.95 significantly expands the stable API surface. Newly stabilized items include enhancements to MaybeUninit, Cell, atomic update and try-update methods, the core::range module, Vec::push_mut, Vec::insert_mut, VecDeque insertion helpers, LinkedList push-mutation helpers, and several Layout methods.

A notable change in Rust 1.95 affects custom targets. Stable support for passing a custom JSON target specification to rustc has been removed. The project states that this will not affect users with a fully stable toolchain, since building the standard library for custom targets already requires nightly-only functionality.

In addition to core compiler and language updates, the release notes highlight further changes across Rust, Cargo, and Clippy. Rust 1.95 represents a comprehensive maintenance and feature update rather than a narrowly focused release.

For a detailed list of changes, refer to the official announcement.

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.

Leave a Reply

Your email address will not be published. Required fields are marked *