Vb65obs0.putty PDocsTechnology
Related
Kubernetes 1.36 and Beyond: SELinux Volume Mount Optimization Becomes StableHow to Interpret GitHub's Enhanced Status Page for Better Service TransparencyToyota Crown Signia: Why Its Two Trims Both Deliver Exceptional ValueApple’s macOS 27 Debuts June 8 With Siri Overhaul, Touch Interface, and Intel Mac Cutoff – BreakingCloudflare’s Agentic Cloud: A New Era for Autonomous AI WorkloadsHow Estrogen Shapes the Brain’s Resilience to Trauma: A Step-by-Step GuideMicrosoft 365 Subscribers Get Critical Security Patch and Copilot Upgrade in Latest Update WaveMastering watchOS 26.5: Update Guide, Bug Fixes, and the New Pride Watch Face

Rust 1.95.0 Rolls Out with Compile-Time Configuration Macro and Enhanced Pattern Matching

Last updated: 2026-05-06 04:43:30 · Technology

Breaking: Rust 1.95.0 Now Available

The Rust team has released version 1.95.0, introducing a new cfg_select! macro that simplifies compile-time configuration and bringing if-let guards to match expressions.

Rust 1.95.0 Rolls Out with Compile-Time Configuration Macro and Enhanced Pattern Matching
Source: blog.rust-lang.org

This update, available immediately via rustup update stable, marks a significant step in Rust's usability for systems programming.

New cfg_select! Macro

cfg_select! acts as a compile-time conditional dispatcher, similar to the popular cfg-if crate but with native syntax.

"This macro allows developers to write platform-specific code without external dependencies," said a Rust core team member.

The macro evaluates a list of configuration predicates and expands to the first matching arm. For example, developers can write cfg_select! { unix => { fn foo() { /* unix code */ } }, _ => { /* fallback */ } }.

if-let Guards in Match Expressions

Building on let chains stabilized in Rust 1.88, version 1.95 extends if-let guards to match patterns.

This allows conditional pattern matching: match value { Some(x) if let Ok(y) = compute(x) => { /* use x and y */ }, _ => {} }.

"This feature enables more expressive and concise code," noted a Rust language designer.

Note: The compiler does not yet consider if-let guards in exhaustiveness checks.

Stabilized APIs and Enhancements

Version 1.95.0 stabilizes over 30 APIs, including MaybeUninit<[T; N]> conversions, Cell array references, and Atomic*::update/try_update methods.

New modules like core::range and the cold_path hint optimize low-level code.

"These stabilizations reflect Rust's commitment to safe, zero-cost abstractions," said a Rust contributor.

Background

Rust 1.95.0 continues the tradition of incremental improvements. The cfg_select! macro addresses long-standing community demand for native conditional compilation, while if-let guards extend pattern matching capabilities first introduced in Rust 1.88.

The release cycle remains six weeks, with nightly builds available for early testing.

What This Means

For developers, Rust 1.95 reduces reliance on external crates for platform-specific code and enhances readability in match statements. The new atomic operations improve concurrency safety.

These features are particularly impactful for embedded, OS, and real-time systems where compile-time decisions are critical.

To upgrade, run rustup update stable. For detailed release notes, see the official changelog.