Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking Issue for saturating_div #89381

Closed
2 tasks done
kellerkindt opened this issue Sep 29, 2021 · 7 comments · Fixed by #88624
Closed
2 tasks done

Tracking Issue for saturating_div #89381

kellerkindt opened this issue Sep 29, 2021 · 7 comments · Fixed by #88624
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@kellerkindt
Copy link
Contributor

kellerkindt commented Sep 29, 2021

The feature gate for the issue is #![feature(saturating_div)].

About tracking issues

This tracking issue tracks the progress of the saturating_div feature, which shall provide a saturating division for integer types. It is part of the ongoing effort to stabilize the Saturating type #87920

Unresolved Questions

None. The implementation has been discussed here and here.

Steps

Implementation history

@kellerkindt kellerkindt added the C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC label Sep 29, 2021
@yaahc yaahc added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Sep 29, 2021
@yaahc
Copy link
Member

yaahc commented Sep 29, 2021

@rfcbot merge

@rfcbot
Copy link

rfcbot commented Sep 29, 2021

Team member @yaahc 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.

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels Sep 29, 2021
@rfcbot
Copy link

rfcbot commented Sep 29, 2021

🔔 This is now entering its final comment period, as per the review above. 🔔

@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Oct 9, 2021
@rfcbot
Copy link

rfcbot commented Oct 9, 2021

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Oct 21, 2021
JohnTitor added a commit to JohnTitor/rust that referenced this issue Oct 22, 2021
Stabilize feature `saturating_div` for rust 1.58.0

The tracking issue is rust-lang#89381

This seems like a reasonable simple change(?). The feature `saturating_div` was added as part of the ongoing effort to implement a `Saturating` integer type (see rust-lang#87921). The implementation has been discussed [here](rust-lang#87921 (comment)) and [here](rust-lang#87921 (comment)). It extends the list of saturating operations on integer types (like `saturating_add`, `saturating_sub`, `saturating_mul`, ...) by the function `fn saturating_div(self, rhs: Self) -> Self`.

The stabilization of the feature `saturating_int_impl` (for the `Saturating` type) needs to have this stabilized first.

Closes rust-lang#89381
@bors bors closed this as completed in 918f9cc Oct 22, 2021
@camelid
Copy link
Member

camelid commented Oct 22, 2021

I'm just curious: why was this feature stabilized so soon after being added? IIRC, usually features wait for at least a couple months before being stabilized.

@yaahc
Copy link
Member

yaahc commented Oct 22, 2021

AFAIK it has been a couple months, I think that it was just missing the tracking issue because they split this out as a partial stabilization from #87920. The original PR adding it landed in late august, #87921, so it was a bit on the fast side but AFAIK we don't have any rule about how long things should remain on nightly before they're eligible for stabilization. Maybe we should? In this case I don't expect it will be a problem, this one seems pretty non-controversial, but I'm curious what the rest of @rust-lang/libs-api thinks.

@c410-f3r
Copy link
Contributor

IIRC, saturating_div is the only saturating_* operator that panics. Although obvious, such behavior should probably deserve a improved documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants