-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Description
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
- Implementation: Add NonZeroUn::is_power_of_two #81107
- Final commenting period (FCP)
- Stabilization PR
Unresolved Questions
- None yet.
leonardo-m, jplatte and matthieu-m
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.