<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/rust-1-96-0-released-new-range-types-pattern-assertions-and-two-cargo-security-fixes-b8qytlefo" -->

---
title: Rust 1.96.0 released: new Range types, pattern...
description: Rust 1.96.0 introduces three new Copy-compatible Range types in core::range (Range, RangeFrom, RangeInclusive) that use IntoIterator instead of Iterator to...
canonical: https://daily.dev/posts/rust-1-96-0-released-new-range-types-pattern-assertions-and-two-cargo-security-fixes-b8qytlefo
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Rust 1.96.0 released: new Range types, pattern assertions, and two Cargo security fixes | daily.dev
og:description: Rust 1.96.0 introduces three new Copy-compatible Range types in core::range (Range, RangeFrom, RangeInclusive) that use IntoIterator instead of Iterator to...
og:url: https://daily.dev/posts/rust-1-96-0-released-new-range-types-pattern-assertions-and-two-cargo-security-fixes-b8qytlefo
og:image: https://api.daily.dev/og/posts/B8QYTlEFo.png
og:image:alt: Rust 1.96.0 released: new Range types, pattern assertions, and two Cargo security fixes
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Rust 1.96.0 released: new Range types, pattern assertions, and two Cargo security fixes

**[Collections](https://daily.dev/sources/collections)** · 2 min read · 15 upvotes · 0 comments

## Summary

Rust 1.96.0 introduces three new Copy-compatible Range types in core::range (Range, RangeFrom, RangeInclusive) that use IntoIterator instead of Iterator to avoid copy-during-iteration issues. Two new macros, assert_matches! and debug_assert_matches!, are now stable for pattern-matching assertions with better diagnostics. WebAssembly targets now produce linker errors on undefined symbols instead of silently generating imports. The release also patches two Cargo security vulnerabilities: CVE-2026-5223 (tarball symlink extraction) and CVE-2026-5222 (URL normalization bug that could leak auth tokens to wrong registries), affecting all Cargo versions shipped with Rust 1.68–1.95.

## Content

Rust 1.96.0 is out. Here's what changed.

## New Copy-compatible Range types

`core::range` now has three new Range types — `Range`, `RangeFrom`, and `RangeInclusive` — that implement `Copy`. The existing types in `std::ops` couldn't implement `Copy` because they implement `Iterator` directly, which causes problems when you copy a range mid-iteration. The new types sidestep this by implementing `IntoIterator` instead, so you can copy them freely and create a fresh iterator when needed.

## Pattern-matching assertions

Two new macros are stable: `assert_matches!` and `debug_assert_matches!`. They let you assert that a value matches a pattern, and give better diagnostics than rolling your own match + panic. `debug_assert_matches!` is stripped in release builds, same as `debug_assert!`.

## WebAssembly undefined symbol behavior

WebAssembly targets now produce a linker error on undefined symbols instead of silently generating imports. This catches mistakes earlier rather than letting them surface at runtime.

## Two Cargo security fixes

This release patches two vulnerabilities:

**CVE-2026-5223 (medium severity)** — A tarball symlink extraction issue. Details are in the separate advisory.

**CVE-2026-5222 (low severity)** — Cargo's URL normalization logic for sparse index registries was incorrectly stripping `.git` suffixes. In a specific scenario — where an attacker can both publish crates and host files at a `.git`-suffixed path on the same domain — they could trick Cargo into sending a victim's authentication token to the wrong registry. The fix restricts `.git` suffix stripping to git-protocol registries only. Every Cargo version shipped with Rust 1.68 through 1.95 is affected. There's no mitigation for older versions other than upgrading.

Neither vulnerability affects crates.io users directly.

## Upgrading

Update via rustup:

```
rustup update stable
```

Full release notes are on the [Rust blog](https://blog.rust-lang.org).

## Similar posts on daily.dev

- [Rust introduces new Range types](https://daily.dev/posts/rust-introduces-new-range-types-txhclns35) · InfoWorld · 25 upvotes · 0 comments
- [Announcing Rust 1.94.1](https://daily.dev/posts/announcing-rust-1-94-1-r8kl7pl4j) · Rust · 4 upvotes · 0 comments
- [Announcing Rust 1.97.0](https://daily.dev/posts/announcing-rust-1-97-0-fqxhq3pfj) · Rust · 22 upvotes · 0 comments

---

Tags: [#rust](https://daily.dev/tags/rust), [#webassembly](https://daily.dev/tags/webassembly)

[View this post on daily.dev](https://daily.dev/posts/rust-1-96-0-released-new-range-types-pattern-assertions-and-two-cargo-security-fixes-b8qytlefo)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Rust 1.96.0 released: new Range types, pattern assertions, and two Cargo security fixes","url":"https://daily.dev/posts/rust-1-96-0-released-new-range-types-pattern-assertions-and-two-cargo-security-fixes-b8qytlefo","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/rust-1-96-0-released-new-range-types-pattern-assertions-and-two-cargo-security-fixes-b8qytlefo"},"datePublished":"2026-05-29T00:25:51.045Z","dateModified":"2026-05-29T00:26:29.522Z","description":"Rust 1.96.0 introduces three new Copy-compatible Range types in core::range (Range, RangeFrom, RangeInclusive) that use IntoIterator instead of Iterator to...","isAccessibleForFree":true,"articleSection":"Collections","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Collections","logo":"https://media.daily.dev/image/upload/s--fk_6ycEi--/f_auto,q_auto/v1780996001/logos/collections?_a=BAMAMiWQ0","url":"https://daily.dev/sources/collections"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/rust-1-96-0-released-new-range-types-pattern-assertions-and-two-cargo-security-fixes-b8qytlefo","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":15},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"rust,webassembly","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Collections","item":"https://daily.dev/sources/collections"},{"@type":"ListItem","position":3,"name":"Rust 1.96.0 released: new Range types, pattern assertions, and two Cargo security fixes"}]}
```

