Rest 1.96.0

The release has been published Rest 1.96.0 — the latest stable version of the Rust programming language. The update has been released. May 28, 2026; it can be installed using the standard rustup update stable command. The main changes include new range types in core::range, stabilization of pattern matching macros, tightening of WebAssembly build behavior, and fixes for two vulnerabilities in Cargo.

Major changes

  • New range types core::range::Range*.
    New range types have been stabilized in the standard library: core::range::Range, RangeFrom, RangeInclusive, and their associated iterators. Unlike the old types from core::ops, the new ranges don't implement Iterator directly, but are converted to an iterator via IntoIterator. This allows these ranges to be Copyable, which is convenient, for example, when storing a range as a structure field. Syntax like 0..1 currently creates the old range types, but it is planned to be migrated to the new types in a future version of the language.

  • Added assert_matches! and debug_assert_matches!.
    New macros allow you to check that a value matches a given pattern. This is similar in concept to assert!(matches!(…)), but in case of an error, a debug representation of the value is printed, simplifying diagnostics. These macros were not added to Prelude to avoid conflicts with popular third-party crates, so they must be explicitly imported from core or std.

  • Changed the behavior of WebAssembly targets.
    Rust no longer passes --allow-undefined to the linker for WebAssembly builds. Undefined symbols are now treated as errors during linking, rather than automatically being converted to imports from the "env" module. This should catch build errors and invalid symbol names earlier. The old behavior can be reverted, if needed, using RUSTFLAGS=-Clink-arg=--allow-undefined or by explicitly specifying the imported wasm module using #[link(wasm_import_module = "env")].

  • Cargo has received security fixes.
    Rust 1.96.0 fixes two vulnerabilities affecting users of third-party registries. CVE-2026-5223 Related to the handling of symlinks within crate tarballs: a malicious package from a third-party registry could overwrite the cache of another package from the same registry. Starting with Rust 1.96.0, Cargo rejects crate archives containing symlinks. CVE-2026-5222 This issue relates to URL normalization in the sparse registry and, under rare circumstances, could result in a Cargo token being sent to a malicious registry. According to the Rust team, crates.io users are not affected by these issues.

  • Changes in language.
    The release includes: Several minor fixes and enhancements: Allowed passing expr metavariables of macros to cfg, corrected never-type casting in tuple expressions, fixed rare cases of incorrect type inference hints for function arguments, added support for s390x vector registers in inline assembly, and re-allowed ManuallyDrop constants as templates—this fixes a regression introduced in Rust 1.94.0.

  • Changes in compiler and platforms.
    For LinuxLink relaxation support has been enabled for LoongArch targets—a linking optimization that simplifies some transitions and calls after code deployment. For riscv64gc-unknown-fuchsia, the base configuration has been updated to the RVA22 profile with support for vector extensions.

  • Standard library updates.
    Support for iterating over NonZero integer ranges has been added. Lazy handling of host addresses in SGX via ToSocketAddr has also been fixed, and the definition of "readable/writeable" memory has been clarified in the documentation and internal contracts: the null pointer has been removed from the general definition, and exceptions are now specified separately for specific methods.

  • Stabilized APIs.
    Among the stabilized interfaces are assert_matches!, debug_assert_matches!, implementations of From for AssertUnwindSafe , LazyCell and LazyLock , as well as new range types and iterators from core::range, including Range, RangeFrom, RangeToInclusive and their iterators.

  • Cargo: Changes to dependencies and documentation.
    A dependency can now specify both a Git repository and an alternative registry: the Git version will be used locally, and the registry version will be used during publishing, similar to the behavior with crates.io. Support for target.'cfg(..)'.rustdocflags in the Cargo configuration has also been added.

  • Rustdoc now handles documentation more accurately.
    Deprecated API notes are now rendered as regular documentation, without the previous special processing via white-space: pre-wrap. Additionally, rustdoc no longer lints missing_doc_code_examples for elements inside impl, and methods and associated functions are now separated in the documentation sidebar.

  • Possible incompatibilities.
    The release contains several changes that may show up in non-standard code: the layout of some #[repr(Int)] enums has been fixed in extreme cases, and some useless unsize casts in Pin have been disabled. , WebAssembly builds now crash on undefined symbols, the accidentally stabilized #![reexport_test_harness_main] attribute has been feature gated again, the -Csoft-float option has been removed, and the minimum external LLVM version has been increased to 21. For AVR, the c_double type has been changed to f32, since C doubles are 32-bit by default on these targets.

Source: linux.org.ru

Buy reliable hosting for sites with DDoS protection, VPS VDS servers šŸ”„ Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster