feat(core): impl Step for NonZero<u*>#127534
feat(core): impl Step for NonZero<u*>#127534jalil-salame wants to merge 8 commits intorust-lang:mainfrom
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @cuviper (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
This comment has been minimized.
This comment has been minimized.
|
UI tests are failing because the output of diagnostics was reorganized now that Its getting late so I'll take a look at it tomorrow and see if I find a way to update the ui tests. |
|
You can use I know you already went through an ACP, but I think this still needs a libs-api reviewer since it is instantly stable -- @rustbot label -T-libs +T-libs-api |
the8472
left a comment
There was a problem hiding this comment.
Regarding the stable API surface: We should also add the appropriate ExactSizeIterator impls, without repeating the 16-bit-platform mistakes.
|
|
718b7a9 to
ca46c6d
Compare
I see that |
ca46c6d to
18adf5f
Compare
|
@joshtriplett friendly ping. Should I assign someone else if you are too busy? |
|
r? libs-api |
|
@rfcbot fcp merge |
|
Team member @Amanieu has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
|
🔔 This is now entering its final comment period, as per the review above. 🔔 |
|
@jalil-salame I ran into code where I wanted this again today, do you have time/motivation to get this PR ready for merging anytime soon? |
18adf5f to
6600730
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
Implement Step for NonZero unsigned integers as discussed in [libs-team#130][1]. [1]: rust-lang/libs-team#130 `step_nonzero_impls` was adapted from `step_integer_impls` and the tests were adapted from the step tests. Signed-off-by: Jalil David Salamé Messina <jalil.salame@gmail.com>
As per review comment Signed-off-by: Jalil David Salamé Messina <jalil.salame@gmail.com>
6600730 to
01b4833
Compare
Signed-off-by: Jalil David Salamé Messina <jalil.salame@gmail.com>
`NonZero<u16>` and `NonZero<usize>` can safely implement `ExactSizeIterator` for `RangeInclussive` Signed-off-by: Jalil David Salamé Messina <jalil.salame@gmail.com>
Small doc change
Specially around the limits Signed-off-by: Jalil David Salamé Messina <jalil.salame@gmail.com>
|
@rustbot label +I-libs-api-nominated FCP completed for this change (#127534 (comment)) but that was about a year ago. I don't expect that anything changed, but re-nominating since it's been a while just to be sure. |
Thanks @programmerjake Signed-off-by: Jalil David Salamé Messina <jalil.salame@gmail.com>
This time for sure
|
LGTM from the libs-api side. |
Implement Step for NonZero unsigned integers as discussed in libs-team#130.
step_nonzero_implswas adapted fromstep_integer_implsand the tests were adapted from the step tests.It seems to compile and pass the tests c:
I would like to test the edge cases, specially around overflows. To ensure safe code cannot generate a 0
NonZero, but I don't know how to go about it. I would love some feedback on that (and the PR overall).The impls are tagges with
#[unstable(feature = "step_trait", reason = "recently redesigned", issue = "42168")]. I assumed this was appropriate, but I am not sure.