Closed
Description
Feature gate: #![feature(nonzero_negation_ops)]
This is a tracking issue for adding negation methods such as wrapping_neg()
to the core::num::NonZeroI{8,16,32,64,128}
types.
Public API
// core::num
for $Ty in NonZeroI{8,16,32,64,128} {
pub const fn is_positive(self) -> bool;
pub const fn is_negative(self) -> bool;
pub const fn checked_neg(self) -> Option<$Ty>;
pub const fn overflowing_neg(self) -> ($Ty, bool);
pub const fn saturating_neg(self) -> $Ty;
pub const fn wrapping_neg(self) -> $Ty;
}
Steps / History
- Implementation: Add negation methods for signed non-zero integers. #102342
- Add
is_positive
method for signed non-zero integers. #111186 - Final comment period (FCP)1
- Stabilization PR: Stabilize feature
nonzero_negation_ops
#111044
Unresolved Questions
- None yet.