-
Notifications
You must be signed in to change notification settings - Fork 331
Add initial 1.95.0 blog #1836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Mark-Simulacrum
wants to merge
4
commits into
rust-lang:main
Choose a base branch
from
Mark-Simulacrum:release-1.95.0
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+98
−0
Open
Add initial 1.95.0 blog #1836
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| +++ | ||
| path = "2026/04/16/Rust-1.95.0" | ||
| title = "Announcing Rust 1.95.0" | ||
| authors = ["The Rust Release Team"] | ||
| aliases = ["releases/1.95.0"] | ||
|
|
||
| [extra] | ||
| release = true | ||
| +++ | ||
|
|
||
| The Rust team is happy to announce a new version of Rust, 1.95.0. Rust is a programming language empowering everyone to build reliable and efficient software. | ||
|
|
||
| If you have a previous version of Rust installed via `rustup`, you can get 1.95.0 with: | ||
|
|
||
| ```console | ||
| $ rustup update stable | ||
| ``` | ||
|
|
||
| If you don't have it already, you can [get `rustup`](https://www.rust-lang.org/install.html) from the appropriate page on our website, and check out the [detailed release notes for 1.95.0](https://doc.rust-lang.org/stable/releases.html#version-1950-2026-04-16). | ||
|
|
||
| If you'd like to help us out by testing future releases, you might consider updating locally to use the beta channel (`rustup default beta`) or the nightly channel (`rustup default nightly`). Please [report](https://github.com/rust-lang/rust/issues/new/choose) any bugs you might come across! | ||
|
|
||
| ## What's in 1.95.0 stable | ||
|
|
||
| ### `cfg_select!` | ||
|
|
||
| Rust 1.95 introduces a | ||
| [`cfg_select!`](https://doc.rust-lang.org/stable/std/macro.cfg_select.html) | ||
| macro that acts roughly similar to a compile-time `match` on `cfg`s. This | ||
| fulfills the same purpose as the popular | ||
| [`cfg-if`](https://crates.io/crates/cfg-if) crate, although with a different | ||
| syntax. `cfg_select!` expands to the right-hand side of the first arm whose | ||
| configuration predicate evaluates to `true`. Some examples: | ||
|
|
||
| ```rust | ||
| cfg_select! { | ||
| unix => { | ||
| fn foo() { /* unix specific functionality */ } | ||
| } | ||
| target_pointer_width = "32" => { | ||
| fn foo() { /* non-unix, 32-bit functionality */ } | ||
| } | ||
| _ => { | ||
| fn foo() { /* fallback implementation */ } | ||
| } | ||
| } | ||
|
|
||
| let is_windows_str = cfg_select! { | ||
| windows => "windows", | ||
| _ => "not windows", | ||
| }; | ||
| ``` | ||
|
|
||
| ### if-let guards in matches | ||
|
|
||
| Rust 1.88 stabilized [let chains](https://blog.rust-lang.org/2025/06/26/Rust-1.88.0/#let-chains). Rust | ||
| 1.95 brings that capability into match expressions, allowing for conditionals | ||
| based on pattern matching. | ||
|
|
||
| ```rust | ||
| match value { | ||
| Some(x) if let Ok(y) = compute(x) => { | ||
| // Both `x` and `y` are available here | ||
| println!("{}, {}", x, y); | ||
| } | ||
| _ => {} | ||
| } | ||
| ``` | ||
|
|
||
| Note that the compiler will not currently consider the patterns matched in `if | ||
| let` guards as part of the exhaustiveness evaluation of the overall match, just | ||
| like `if` guards. | ||
|
|
||
| ### Stabilized APIs | ||
|
|
||
| See draft release notes, will get copied after those are non-draft: | ||
|
|
||
| <https://github.com/rust-lang/rust/issues/154711#:~:text=Stabilized%20APIs> | ||
|
|
||
| ### Destabilized JSON target specs | ||
|
|
||
| Rust 1.95 removes support on stable for passing a custom target specification | ||
| to `rustc`. This should **not** affect any Rust users using a fully stable | ||
| toolchain, as building the standard library (including just `core`) already | ||
| required using nightly-only features. | ||
|
|
||
| We're also gathering use cases for custom targets on the [tracking issue](https://github.com/rust-lang/rust/issues/151528) | ||
| as we consider whether some form of this feature should eventually be stabilized. | ||
|
|
||
| ### Other changes | ||
|
|
||
| Check out everything that changed in [Rust](https://github.com/rust-lang/rust/releases/tag/1.95.0), [Cargo](https://doc.rust-lang.org/nightly/cargo/CHANGELOG.html#cargo-195-2026-04-16), and [Clippy](https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-195). | ||
|
|
||
| ## Contributors to 1.95.0 | ||
|
|
||
| Many people came together to create Rust 1.95.0. We couldn't have done it without all of you. [Thanks!](https://thanks.rust-lang.org/rust/1.95.0/) | ||
|
|
||
| [platform-support]: https://doc.rust-lang.org/rustc/platform-support.html | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
View changes since the review
I don't know if this is worth calling out explicitly. I was actually half-expecting that this does participate in exhaustiveness analysis (it seems like we could make it do that, for the case where the RHS of the if let is a value from the match's expression).
I'm guessing our mental model is that these are 'just' guards though in which case the implemented behavior makes sense. If so, maybe we should strike 'currently' from this text.