E-Ink News Daily

Back to list

RangeFrom, Part 2..: What I think is wrong about the design

The author critiques the design of Rust's RangeFrom iterator, pointing out that it fails to yield the maximum value when overflow checks are enabled due to an internal counter increment-before-yield implementation detail. The issue has since been addressed by new range types in std::range, but the post highlights important lessons about iterator semantics and overflow behavior in Rust.

Background

Rust's RangeFrom (e.g., `n..`) is a common iterator type that yields values from n onward. This article is part two of a series examining design flaws in its implementation.

Source
Lobsters
Published
Sep 1, 2026 at 12:53 AM
Score
6.0 / 10