Skip to content

dont rely on behaviour of RangeInclusive after exhaustion - #30

Merged
roeeshoshani merged 2 commits into
masterfrom
bugfix/inclusive_range
Jul 31, 2026
Merged

roeeshoshani merged 2 commits into
masterfrom
bugfix/inclusive_range

Conversation

@roeeshoshani

Copy link
Copy Markdown
Owner

the current code heavily relied on the internal implementation of RangeInclusive, especially regarding its state post exhaustion, which according to official docs, is unspecified.

relying on these unspecified internal implementation details is a bad idea, and the problems surfaced when the internal implementation actually changed, in rust-lang/rust#155114. suddenly, the tests didn't pass on nightly.

so, change the implementation to avoid relying on internal implementation details of rust's stdlib, and instead design my own custom API for the inclusive range type which is separate from stdlib's one.

the current code heavily relied on the internal implementation of
RangeInclusive, especially regarding its state post exhaustion, which
according to official docs, is unspecified.

relying on these unspecified internal implementation details is a bad
idea, and the problems surfaced when the internal implementation
actually changed, in rust-lang/rust#155114.
suddenly, the tests didn't pass on nightly.

so, change the implementation to avoid relying on internal
implementation details of rust's stdlib, and instead design my own
custom API for the inclusive range type which is separate from stdlib's
one.
@roeeshoshani
roeeshoshani merged commit 0d72966 into master Jul 31, 2026
7 checks passed
@roeeshoshani
roeeshoshani deleted the bugfix/inclusive_range branch July 31, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant