Step::steps_between does not distinguish overflow and unimplemented (unstable) #48117
Labels
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
It returns
Option<size>
: https://doc.rust-lang.org/std/iter/trait.Step.html#tymethod.steps_betweenAnd the comment says it uses
None
for overflow: https://doc.rust-lang.org/src/core/iter/range.rs.html#29But it also uses
None
for unimplemented https://doc.rust-lang.org/src/core/iter/range.rs.html#155And as a result,
Range
needs to return(0, None)
when it getsNone
: https://doc.rust-lang.org/src/core/iter/range.rs.html#235-240It would be nice to either
Step
is expected to support graph walks, but maybe not harder thanPartialOrd
)Option<Option<usize>>
or be more hint-like with(usize, Option<usize>)
cc #42168
The text was updated successfully, but these errors were encountered: