mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
nonzero_negation_ops: Set issue = "102443"
.
This commit is contained in:
parent
259bbfbc3d
commit
cdae82c5fc
@ -743,7 +743,7 @@ macro_rules! nonzero_signed_operations {
|
||||
/// ```
|
||||
#[must_use]
|
||||
#[inline(always)]
|
||||
#[unstable(feature = "nonzero_negation_ops", issue = "none")]
|
||||
#[unstable(feature = "nonzero_negation_ops", issue = "102443")]
|
||||
pub const fn is_negative(self) -> bool {
|
||||
self.get().is_negative()
|
||||
}
|
||||
@ -769,7 +769,7 @@ macro_rules! nonzero_signed_operations {
|
||||
/// # }
|
||||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "nonzero_negation_ops", issue = "none")]
|
||||
#[unstable(feature = "nonzero_negation_ops", issue = "102443")]
|
||||
pub const fn checked_neg(self) -> Option<$Ty> {
|
||||
if let Some(result) = self.get().checked_neg() {
|
||||
// SAFETY: negation of nonzero cannot yield zero values.
|
||||
@ -802,7 +802,7 @@ macro_rules! nonzero_signed_operations {
|
||||
/// # }
|
||||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "nonzero_negation_ops", issue = "none")]
|
||||
#[unstable(feature = "nonzero_negation_ops", issue = "102443")]
|
||||
pub const fn overflowing_neg(self) -> ($Ty, bool) {
|
||||
let (result, overflow) = self.get().overflowing_neg();
|
||||
// SAFETY: negation of nonzero cannot yield zero values.
|
||||
@ -836,7 +836,7 @@ macro_rules! nonzero_signed_operations {
|
||||
/// # }
|
||||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "nonzero_negation_ops", issue = "none")]
|
||||
#[unstable(feature = "nonzero_negation_ops", issue = "102443")]
|
||||
pub const fn saturating_neg(self) -> $Ty {
|
||||
if let Some(result) = self.checked_neg() {
|
||||
return result;
|
||||
@ -869,7 +869,7 @@ macro_rules! nonzero_signed_operations {
|
||||
/// # }
|
||||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "nonzero_negation_ops", issue = "none")]
|
||||
#[unstable(feature = "nonzero_negation_ops", issue = "102443")]
|
||||
pub const fn wrapping_neg(self) -> $Ty {
|
||||
let result = self.get().wrapping_neg();
|
||||
// SAFETY: negation of nonzero cannot yield zero values.
|
||||
|
Loading…
Reference in New Issue
Block a user