Rust 1.95 released
Rust 1.95 shipped with a new 'match if‑let guard' syntax that simplifies pattern matching and can make code for performance‑sensitive services more concise. The update is being discussed as useful for safer, clearer pattern handling in backend systems often used in fintech. (X: Linda_pp)
Rust 1.95 landed on April 16 with a new way to write `match` conditions, letting developers pattern-match inside a guard instead of splitting logic across extra branches. (blog.rust-lang.org) Rust is a systems programming language used for software that needs speed and strict memory safety, including servers, command-line tools, browsers, and operating system components. The Rust team said 1.95.0 is now on the stable channel and can be installed with `rustup update stable`. (blog.rust-lang.org) The new syntax is called an `if let` guard on a `match` arm. In plain terms, it lets a program check not just “did this shape match,” but also “did a second pattern inside that condition match too,” all in one arm. (doc.rust-lang.org) (rust-lang.github.io) Rust’s release post showed the form as `Some(x) if let Ok(y) = compute(x) => {... }`, where both `x` and `y` are available in the selected branch. Before this stabilization, developers often had to move that second pattern check into nested `if let` code or duplicate handling in another branch. (blog.rust-lang.org) (rust-lang.github.io) The feature builds on “let chains,” which Rust stabilized in version 1.88 in June 2025. Rust 1.95 extends that style into `match` expressions, so the same pattern-based conditionals can now sit directly beside the arm they control. (blog.rust-lang.org) The underlying problem is code flow. The 2018 design document for `if let` guards said the feature helps when a program needs to accept a pattern only if a value derived from matched data also has a certain form, and when recomputing that value may be costly or impossible. (rust-lang.github.io) That matters in backend code that handles enums, results, and parsed inputs over and over, because Rust programs often use `match` as the main way to sort different cases. Keeping the destructuring and the condition in one arm can make those paths shorter and avoid temporary control-flow detours, an inference supported by the RFC’s examples and the release team’s sample code. (rust-lang.github.io) (blog.rust-lang.org) Rust’s own caveat is that the compiler does not yet count patterns matched inside `if let` guards when it checks whether a `match` covers every possible case. The release notes say that behavior is the same as ordinary `if` guards, so developers still need a fallback arm such as `_ => {}` when coverage is not otherwise complete. (blog.rust-lang.org) (doc.rust-lang.org) Rust 1.95 also shipped other language and library changes, including a new `cfg_select!` macro for compile-time configuration and a long list of stabilized application programming interfaces, or APIs. But the `if let` guard change is the one that alters how everyday pattern-matching code can be written on stable Rust starting April 16. (blog.rust-lang.org) (doc.rust-lang.org) The feature was first proposed in January 2018 as RFC 2294 and reached stable Rust more than eight years later in version 1.95. For developers who write `match`-heavy code, the update turns a long-discussed syntax into something they can use in production now. (rust-lang.github.io) (blog.rust-lang.org)