Skip to content

Tracking Issue for negation methods on NonZeroI* #102443

Closed
@jmillikin

Description

@jmillikin

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.

ACP: rust-lang/libs-team#105

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

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: 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.disposition-mergeThis 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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions