Open
Description
Split off from #27741 because the stabilization path for step_by
has moved to being on iterators (#41439), and thus not using the Step
trait.
- Remove
step
,steps_between
, andis_negative
once Range::step_by is deletedReplacereplace_zero
andreplace_one
with something more useful (some options: Make RangeInclusive just a two-field struct (amend 1192) rfcs#1980 (comment))Changesteps_between_by_one
so thatRange<u128>
can beTrustedLen
(rather than it only working well with types that fit inusize
)Make a decision on howsteps_between
should work Step::steps_between does not distinguish overflow and unimplemented (unstable) #48117
(and probably more)
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
Rollup merge of rust-lang#42169 - scottmcm:new-step-trait-issue, r=al…
Rollup merge of rust-lang#42169 - scottmcm:new-step-trait-issue, r=al…
Rollup merge of rust-lang#42169 - scottmcm:new-step-trait-issue, r=al…
Rollup merge of rust-lang#42169 - scottmcm:new-step-trait-issue, r=al…
Rollup merge of rust-lang#42169 - scottmcm:new-step-trait-issue, r=al…
Rollup merge of rust-lang#42169 - scottmcm:new-step-trait-issue, r=al…
step_by
stabilization #27741scottmcm commentedon Jun 9, 2017
Some progress on this in #42534
SimonSapin commentedon Jul 5, 2017
PR #43077 does items 1
and 3in the original message of this issue.SimonSapin commentedon Jul 6, 2017
I’ve removed the i128/u128 stuff from my PR because I suspect my mixed-signdeness mixed-width interger arithmetic was buggy. I also massaged the
Step
trait some more and came up with this:How does it look?
I’m a bit uncertain of the exact impls for integers, there is up to 6 cases to consider: {smaller, same width, larger} than usize/isize × {signed, unsigned}.
89 remaining items