Rust 1.96.0 Yayınlandı: Yeni Range Türleri ve Güvenlik Yamaları
Rust 1.96.0, Copy destekli yeni core::range türleri, assert_matches! makrosu, WebAssembly linker değişiklikleri ve iki Cargo güvenlik yamasıyla geldi.
The Rust team has released version 1.96.0, headlined by the stabilization of new core::range types (Range, RangeFrom, RangeInclusive) from RFC3550. Unlike the legacy Range types, which implement Iterator and therefore can't be Copy, these new types implement IntoIterator instead, allowing them to derive Copy. This lets developers store slice accessors in Copy structs without manually splitting start and end fields. The classic 0..1 syntax still produces legacy types for now but will migrate to the new range types in a future edition.
The release also stabilizes assert_matches! and debug_assert_matches! macros, which behave like assert!(matches!(..)) but print a Debug representation of the value on failure for easier diagnostics. To avoid clashing with popular third-party crates, these macros are not added to the prelude and must be imported explicitly.
A notable change affects WebAssembly targets: the linker no longer passes --allow-undefined by default, turning undefined linking symbols into hard errors instead of silently converting them into imports from the "env" module. This catches build misconfigurations earlier; the old behavior can still be restored via RUSTFLAGS or explicit link attributes. Additionally, 1.96 patches two Cargo vulnerabilities affecting users of third-party registries — one related to symlink extraction from crate tarballs, another to authentication with normalized URLs — though crates.io users are unaffected.
These changes have direct practical implications for engineers: library authors gain a cleaner way to expose Copy-friendly ranges, while WebAssembly projects benefit from earlier detection of linking bugs.