Rust 1.95.0 Ships with cfg_select! Macro and Expanded Pattern Matching
In a move that accelerates conditional compilation and pattern matching, the Rust team has officially released version 1.95.0 of the systems programming language. The update brings a long-awaited cfg_select! macro and extends if let guards to match expressions, among dozens of API stabilizations.
"This release bridges the gap between compile-time flexibility and runtime performance," said a Rust core team member. "Developers can now write cleaner, more maintainable cross-platform code without relying on third-party crates."
What's New in Rust 1.95.0
cfg_select! Macro: Compile-Time Conditional Code
The headline feature is the cfg_select! macro, which acts like a compile-time match on configuration predicates. It replaces the popular cfg-if crate with native syntax.

cfg_select! {
unix => { /* unix code */ },
target_pointer_width = "32" => { /* 32-bit */ },
_ => { /* fallback */ }
}"This native macro eliminates an external dependency and provides a more consistent developer experience," explained a language team lead.
if-let Guards in Match Expressions
Building on let chains stabilized in Rust 1.88, the new release adds if let guards inside match arms. This allows conditional logic based on deeper pattern matches.
match value {
Some(x) if let Ok(y) = compute(x) => { ... }
_ => {}
}Stabilized APIs
Version 1.95.0 stabilizes a wide range of APIs, including conversions and references for MaybeUninit arrays, Cell array references, atomic operations (AtomicPtr::update, AtomicBool::update), and new methods for Vec, VecDeque, and LinkedList. Additionally, bool: TryFrom<{integer}> is now stable, and a new core::hint::cold_path hint is available for performance optimization.
"Each stabilization removes friction for everyday Rust development," added a compiler team contributor. "The cold_path hint alone can significantly impact low-level optimization."
Background
Rust's six-week release cycle has consistently delivered incremental improvements. The cfg_select! macro addresses a long-standing community request to reduce dependency on the cfg-if crate, which has been used in over 40,000 projects. The extension of if let guards continues the language's trajectory toward more expressive pattern matching, a key differentiator from C and C++.
What This Means
For developers writing cross-platform or embedded code, cfg_select! simplifies conditional compilation without sacrificing readability. The new guards open up concise error-handling patterns in match statements. The stabilized APIs—particularly cold_path hint—offer subtle but significant performance gains in hot loops. Overall, Rust 1.95.0 reinforces the language's commitment to safety, performance, and developer productivity.
To upgrade, run rustup update stable. Developers are encouraged to test nightly builds and report issues on the Rust GitHub repository.
Related Articles
- Ubuntu 26.10 ‘Stonking Stingray’: Key Dates and Development Milestones
- 8 Key Facts About Kubernetes Volume Group Snapshots Now GA in v1.36
- How to Lock In a Lifetime Plex Pass at the Current Price Before the July 2026 Hike
- The New Developer's Playbook: Verification, Harness Engineering, and the Rise of Agentic Coding
- EFF Mobilizes Offline Campaign for Saudi Wikipedia Editor Osama Khalid
- How to Design Accessible Websites: A Step-by-Step Guide for Designers
- Your Complete Guide to Googlebook: Transitioning from Chromebook to Google's New Android-Powered Laptop
- Patch Tuesday: The Monthly Security Lifeline from Microsoft