Skip to content

Tracking Issue for NonZeroUn::is_power_of_two (feature nonzero_is_power_of_two) #81106

New issue

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

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

Already on GitHub? # to your account

Closed
1 of 3 tasks
Tracked by #16
scottmcm opened this issue Jan 17, 2021 · 6 comments · Fixed by #91301
Closed
1 of 3 tasks
Tracked by #16

Tracking Issue for NonZeroUn::is_power_of_two (feature nonzero_is_power_of_two) #81106

scottmcm opened this issue Jan 17, 2021 · 6 comments · Fixed by #91301
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

@scottmcm
Copy link
Member

scottmcm commented Jan 17, 2021

Feature gate: #![feature(nonzero_is_power_of_two)]

This is a tracking issue for NonZeroUsize::is_power_of_two (and friends for the other unsigned types).

Like NonZeroUsize::leading_zeros (#79143), this generates simpler code than the underlying integer type because it can avoid a separate zero check.

Public API

impl NonZeroUsize {
    pub fn is_power_of_two(self) -> bool;
}

// And also for NonZeroU8, NonZeroU16, ...

Steps / History

Unresolved Questions

  • None yet.
@scottmcm scottmcm added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC labels Jan 17, 2021
@raphaelcohn

This comment has been minimized.

@scottmcm scottmcm added the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Nov 12, 2021
@scottmcm
Copy link
Member Author

scottmcm commented Nov 12, 2021

With NonZeroU#::leading_zeros stabilized, I would like to propose NonZeroU#::is_power_of_two for stabilization as well.

(I think this in the tracking issue is the right thing to do now, rather than filing a PR?)

@joshtriplett
Copy link
Member

@rust-lang/libs-api, shall we stabilize NonZeroU*::is_power_of_two?

@rfcbot merge

@rfcbot
Copy link
Collaborator

rfcbot commented Nov 15, 2021

Team member @joshtriplett 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. labels Nov 15, 2021
@m-ou-se m-ou-se removed the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Nov 17, 2021
@rfcbot rfcbot added 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 Nov 17, 2021
@rfcbot
Copy link
Collaborator

rfcbot commented Nov 17, 2021

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

@rfcbot rfcbot added the finished-final-comment-period The final comment period is finished for this PR / Issue. label Nov 27, 2021
@rfcbot
Copy link
Collaborator

rfcbot commented Nov 27, 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.

@rfcbot rfcbot added 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 Nov 27, 2021
@bors bors closed this as completed in 27d5935 Nov 28, 2021
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Dec 9, 2021
# for free to join this conversation on GitHub. Already have an account? # 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