Rust 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.96 is uitgebracht en de releasenotes voor die uitgave kunnen hieronder worden gevonden.
NewRange*typesMany users expect
Rangeand relatedcore::opstypes to beCopy, but this is not the case: they implementIteratordirectly, and it is a footgun to implement bothIteratorandCopyon the same type so this has been avoided. RFC3550 proposed a set of replacement range types that implementIntoIteratorrather thanIterator, meaning they can also beCopy. The standard library portion of that RFC is now stable, introducing:
core::range::Rangecore::range::RangeFromcore::range::RangeInclusive- Associated iterators
A Rust version in the near future will also add
core::range::RangeFullandcore::range::RangeToas re-exports fromcore::ops(these do not implementIteratorand already implementCopy), andcore::range::legacy::*as the new home for the current ranges. Range syntax like0..1still produces the legacy types for now, but will be updated tocore::rangetypes in a future edition.With these stabilizations, it is now possible to store slice accessors in
Copytypes without splittingstartandend:use core::range::Range; #[derive(Clone, Copy)] pub struct Span(Range<usize>); impl Span { pub fn of(self, s: &str) -> &str { &s[self.0] } }The new
RangeInclusivealso makes its fields public, unlike the legacy version which avoided exposing the exhausted iterator state. This isn't a concern with the new type since it must be converted to begin iteration.Library authors should consider making use of
Assert matching patternsimpl RangeBoundsin public API, which accepts both legacy and new range types. If a concrete type is needed, prefer using new ranges as this will eventually become the default.The new macros
assert_matches!anddebug_assert_matches!check that a value matches a given pattern, panicking with aDebugrepresentation of the value otherwise. These are essentially the same asassert!(matches!(..))anddebug_assert!(matches!(..)), but the printed value improves the possibility of diagnosing the failure.These new macros have not been added to the standard prelude, because they would collide with popular third-party crates that provide macros with the same name. Instead, they should be manually imported from
coreorstdbefore use.Changes to WebAssembly targetsuse core::assert_matches; /// [Random Number](https://xkcd.com/221/) fn get_random_number() -> u32 { // chosen by a fair dice roll. // guaranteed to be random. 4 } fn main() { assert_matches!(get_random_number(), 1..=6); }WebAssembly targets no longer pass
--allow-undefinedto the linker which means that undefined symbols when linking are now a linker error instead of being converted to WebAssembly imports from the"env"module. This change prevents modules from linking unless all linking-related symbols are defined to catch bugs earlier and prevent accidental issues with symbol naming or similar.Undefined linking-related symbols are often indicative of build-time related bugs or misconfiguration. If, however, the old behavior is intended then it can be re-enabled with
RUSTFLAGS=-Clink-arg=--allow-undefinedor by editing the source code and using#[link(wasm_import_module = "env")]on the block defining the symbol.This change was previously announced on this blog, and now takes effect in Rust 1.96.
Stabilized APIsTwo Cargo advisories
assert_matches!debug_assert_matches!From<T> for AssertUnwindSafe<T>From<T> for LazyCell<T, F>From<T> for LazyLock<T, F>core::range::RangeToInclusivecore::range::RangeToInclusiveItercore::range::RangeFromcore::range::RangeFromItercore::range::Rangecore::range::RangeIterRust 1.96 contains fixes for two vulnerabilities for users of third-party registries.
- CVE-2026-5223 is a medium severity vulnerability regarding extraction of crate tarballs with symlinks.
- CVE-2026-5222 is a low severity vulnerability regarding authentication with normalized URLs.
Users of crates.io are not affected by either vulnerability.
Other changesCheck out everything that changed in Rust, Cargo, and Clippy.
