You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RangeInclusive<T>.exhausted is set inconsistently #164633
While looking at the implementation of RangeInclusive<T>, I noticed that the exhausted field is set under different conditions depending on what methods you call.
It looks like originally, the exhausted flag was set whenever the range became empty due to start moving past end (or vice versa).
Then #155114 updated the next, nth, next_back and nth_back methods to set the exhausted flag only when an arithmetic overflow occurs. But it left spec_try_fold and spec_try_rfold with the previous behaviour.
This leaves the logic in an inconsistent state. Ideally the spec_try_(r)fold functions should be updated to use the same conditions as the other methods.
Activity