SOFTWARE / SYSTEMS / AIEngineering news. Technical depth.
NEWS / Languages · 2 MIN READ

Rust 1.96 separates range values from their iterators

Rust 1.96 stabilizes new range types that can be copied, while existing range syntax keeps its meaning and WebAssembly linking becomes stricter.

Announcement: · From Rust

Rust released version 1.96.0 on May 28 with a new family of range types. The announcement describes a distinction that matters for API design: a reusable description of a range and the state of an iterator do not have to be the same object.

Range syntax stays familiar for now

The new core::range types implement IntoIterator rather than directly implementing Iterator, allowing appropriate range values to be copied. Existing range syntax still produces the legacy types. The release also adds pattern assertion macros and stops automatically accepting undefined linking symbols for WebAssembly targets.

For library maintainers, the range change is an opportunity to examine what an API really accepts. A method that needs bounds can advertise that requirement without forcing callers to share a particular concrete representation. A data structure that stores spans should make clear whether those spans represent positions or partially consumed traversal state.

Separate API cleanup from linking changes

A migration can begin with one internal span type and its consumers. Check cloning, repeated access, and conversion into iteration as separate behaviors. Keeping a small change makes it easier to see whether a new type improves the public interface or merely replaces a spelling.

WebAssembly users have a different check: inspect any new undefined-symbol failure before restoring the previous permissive behavior. Identify whether the symbol was intended as a host import or should have come from another linked object.

The useful outcome is an explicit contract at both boundaries. Range users should know what can be reused, and module builders should know which symbols the host must provide.

SOURCES & CONTEXT

See the original announcement for availability and release details.