Software-update: Rust 1.95.0

Rust logoRust is een programmeertaal bedacht door Graydon Hoare en oorspronkelijk ontwikkeld door Mozilla. Het is deels geïnspireerd op de programmeertaal C, maar kent syntactische en semantische verschillen. Het focust op veiligheid en moet moderne computersystemen efficiënter benutten. Het wordt onder meer ingezet door Cloudflare, OVH, Mozilla, Deliveroo, Coursera, AppSignal en Threema. Versie 1.95 is uitgebracht en de releasenotes voor die uitgave kunnen hieronder worden gevonden.

cfg_select!

Rust 1.95 introduces a cfg_select! macro that acts roughly similar to a compile-time match on cfgs. This fulfills the same purpose as the popular 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:

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. Rust 1.95 brings that capability into match expressions, allowing for conditionals based on pattern matching.

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

These previously stable APIs are now stable in const contexts:

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 as we consider whether some form of this feature should eventually be stabilized.

Other changes

Check out everything that changed in Rust, Cargo, and Clippy.

Rust

Versienummer 1.95.0
Releasestatus Final
Website The Rust Programming Language Blog
Download https://www.rust-lang.org/install.html
Licentietype Voorwaarden (GNU/BSD/etc.)

Door Bart van Klaveren

Downloads en Best Buy Guide

17-04-2026 • 10:30

4

Submitter: danmark_ori

Bron: The Rust Programming Language Blog

Update-historie

17-04 Rust 1.95.0 4
09-03 Rust 1.94.0 0
23-01 Rust 1.93.0 6
13-12 Rust 1.92.0 0
31-10 Rust 1.91.0 0
19-09 Rust 1.90.0 10
09-08 Rust 1.89.0 1
06-'25 Rust 1.88.0 8
05-'25 Rust 1.87.0 1
04-'25 Rust 1.86.0 0
Meer historie

Reacties (4)

Sorteer op:

Weergave:

Ik heb recent voor het eerst naar Rust zitten kijken.
Ziet eruit als een "soort van" moderne variant van C, waarbij modernere taal concepten worden toegepast, zonder belangrijke principes van C uit het oog te verliezen.

Zelfs de Linux Kernel gaat nu (langzaam aan) Rust gebruiken....

[Reactie gewijzigd door GarBaGe op 17 april 2026 10:47]

Rust komt in mijn optiek het meest overeen met C++. In C gebruik je geen RAII, generics, en lambdas. In Rust en C++ komen deze concepten uitgebreid voor.

Qua foutafhandeling is het wel net zoals C. Er zijn geen exceptions, en foutmeldingen moet je expliciet afhandelen. In C kan je foutmeldingen echter veel makkelijker negeren dan in Rust.
Een groot verschil tussen Rust en C++ is dat ze samenstellen boven overerven prefereren.

Verder kun je in Rust mogelijke foutcondities ook negeren door unwrap() maar stopt je programma direct als het toch leeg was: het werkt dus niet verder met verkeerde gegevens zoals C/C++ wel doen.

Een hele fijne taal voor mij als hobby programmeur, omdat ook bij grote projecten ik netjes met mijn denkfouten word geconfronteerd.
Volgens mij zit er een typfout in de lijst met “Stabilized APIs”: AtomicIn en AtomicUn moeten AtomicIsize en AtomicUsize zijn.

Om te kunnen reageren moet je ingelogd zijn