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
- 10 Key Takeaways from Evan Blass's Departure: The End of an Era in Smartphone Leaks
- Beyond the Spinner: How to Design Trustworthy AI Status Updates
- Pixel Perks: Ranking Google's Top Exclusive Features
- Breaking: PCOS Renamed to PMOS in Major Medical Rebranding
- Bridging the Gap: Why Accessible Design Eludes Even the Best Designers
- Urgent: Python 3.14.3 and 3.13.12 Released with Critical Bug Fixes and Next-Gen Features
- How to Scale Cloud and AI Infrastructure with Microsoft Azure Across Europe
- Campervanning Survival Game Shifts Launch to Avoid Subnautica 2’s Early Access Shadow