-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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(generic_nonzero)]
This is a tracking issue for replacing the distinct NonZero* types with a generic NonZero<T> type. This allows using NonZero with FFI type aliases instead of having weird type names like NonZero_c_ulonglong.
This replaces the following tracking issues:
Public API
use core::num::{NonZero, NonZeroU8};
assert_eq!(NonZero::new(33u8), NonZeroU8::new(33));Steps / History
- Initial implementation attempt: Add generic
NonZerotype. #100428 - Consolidate all associated items on the NonZero integer types into a single impl block per type #118665
- Add private
NonZero<T>type alias. #119990 - Manually implement derived
NonZerotraits. #120160 - Switch
NonZeroalias direction. #120165 - Use
SelfinNonZero*implementations. #120244 - Make
NonZeroconstructors generic. #120521 - Use
transmute_uncheckedinNonZero::new. #120809 - Make
NonZero::getgeneric. #120563 - Use generic
NonZerointernally. #120486 - Make other methods generic. (optional, can happen after stabilization)
- Refactor trait implementations in
core::convert::num. #121277 - Use generic
NonZeroeverywhere inlibrary. #121454 - Use generic
NonZeroin tests. #121461 - Make
ZeroablePrimitivetrait unsafe. #121850 - Final comment period (FCP)1
- Stabilization
- Generic
NonZeropost-stabilization changes. #124587
Unresolved Questions
- None yet.
Footnotes
murka, fan-tom, Stranger6667, aznhe21, Luracasmus and 12 morejoshtriplett, kennytm, ljedrz, Nadrieril, Luracasmus and 3 morejoboet, Luracasmus, juntyr, kpreid, LGFae and 1 more
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.