Rollup merge of #97908 - iago-lito:stabilize_nonzero_checked_ops_constness, r=scottmcm

Stabilize NonZero* checked operations constness.

Partial stabilization for #97547 (continued).
This commit is contained in:
Matthias Krüger
2022-06-26 19:47:02 +02:00
committed by GitHub
+26 -26
View File
@@ -316,7 +316,6 @@ impl $Ty {
/// # Examples
///
/// ```
/// #![feature(nonzero_ops)]
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
/// # fn main() { test().unwrap(); }
@@ -331,7 +330,8 @@ impl $Ty {
/// # Some(())
/// # }
/// ```
#[unstable(feature = "nonzero_ops", issue = "84186")]
#[stable(feature = "nonzero_checked_ops", since = "1.64.0")]
#[rustc_const_stable(feature = "const_nonzero_checked_ops", since = "1.64.0")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@@ -351,7 +351,6 @@ pub const fn checked_add(self, other: $Int) -> Option<$Ty> {
/// # Examples
///
/// ```
/// #![feature(nonzero_ops)]
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
/// # fn main() { test().unwrap(); }
@@ -366,7 +365,8 @@ pub const fn checked_add(self, other: $Int) -> Option<$Ty> {
/// # Some(())
/// # }
/// ```
#[unstable(feature = "nonzero_ops", issue = "84186")]
#[stable(feature = "nonzero_checked_ops", since = "1.64.0")]
#[rustc_const_stable(feature = "const_nonzero_checked_ops", since = "1.64.0")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@@ -415,7 +415,6 @@ pub const fn saturating_add(self, other: $Int) -> $Ty {
/// # Examples
///
/// ```
/// #![feature(nonzero_ops)]
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
/// # fn main() { test().unwrap(); }
@@ -432,7 +431,8 @@ pub const fn saturating_add(self, other: $Int) -> $Ty {
/// # Some(())
/// # }
/// ```
#[unstable(feature = "nonzero_ops", issue = "84186")]
#[stable(feature = "nonzero_checked_ops", since = "1.64.0")]
#[rustc_const_stable(feature = "const_nonzero_checked_ops", since = "1.64.0")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@@ -521,7 +521,6 @@ impl $Ty {
/// # Example
///
/// ```
/// #![feature(nonzero_ops)]
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
/// # fn main() { test().unwrap(); }
@@ -534,7 +533,8 @@ impl $Ty {
/// # Some(())
/// # }
/// ```
#[unstable(feature = "nonzero_ops", issue = "84186")]
#[stable(feature = "nonzero_checked_ops", since = "1.64.0")]
#[rustc_const_stable(feature = "const_nonzero_checked_ops", since = "1.64.0")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@@ -551,7 +551,6 @@ pub const fn abs(self) -> $Ty {
/// # Example
///
/// ```
/// #![feature(nonzero_ops)]
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
/// # fn main() { test().unwrap(); }
@@ -566,7 +565,8 @@ pub const fn abs(self) -> $Ty {
/// # Some(())
/// # }
/// ```
#[unstable(feature = "nonzero_ops", issue = "84186")]
#[stable(feature = "nonzero_checked_ops", since = "1.64.0")]
#[rustc_const_stable(feature = "const_nonzero_checked_ops", since = "1.64.0")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@@ -586,7 +586,6 @@ pub const fn checked_abs(self) -> Option<$Ty> {
/// # Example
///
/// ```
/// #![feature(nonzero_ops)]
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
/// # fn main() { test().unwrap(); }
@@ -602,7 +601,8 @@ pub const fn checked_abs(self) -> Option<$Ty> {
/// # Some(())
/// # }
/// ```
#[unstable(feature = "nonzero_ops", issue = "84186")]
#[stable(feature = "nonzero_checked_ops", since = "1.64.0")]
#[rustc_const_stable(feature = "const_nonzero_checked_ops", since = "1.64.0")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@@ -621,7 +621,6 @@ pub const fn overflowing_abs(self) -> ($Ty, bool) {
/// # Example
///
/// ```
/// #![feature(nonzero_ops)]
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
/// # fn main() { test().unwrap(); }
@@ -642,7 +641,8 @@ pub const fn overflowing_abs(self) -> ($Ty, bool) {
/// # Some(())
/// # }
/// ```
#[unstable(feature = "nonzero_ops", issue = "84186")]
#[stable(feature = "nonzero_checked_ops", since = "1.64.0")]
#[rustc_const_stable(feature = "const_nonzero_checked_ops", since = "1.64.0")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@@ -657,7 +657,6 @@ pub const fn saturating_abs(self) -> $Ty {
/// # Example
///
/// ```
/// #![feature(nonzero_ops)]
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
/// # fn main() { test().unwrap(); }
@@ -677,7 +676,8 @@ pub const fn saturating_abs(self) -> $Ty {
/// # Some(())
/// # }
/// ```
#[unstable(feature = "nonzero_ops", issue = "84186")]
#[stable(feature = "nonzero_checked_ops", since = "1.64.0")]
#[rustc_const_stable(feature = "const_nonzero_checked_ops", since = "1.64.0")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@@ -692,7 +692,6 @@ pub const fn wrapping_abs(self) -> $Ty {
/// # Example
///
/// ```
/// #![feature(nonzero_ops)]
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
#[doc = concat!("# use std::num::", stringify!($Uty), ";")]
///
@@ -712,7 +711,8 @@ pub const fn wrapping_abs(self) -> $Ty {
/// # Some(())
/// # }
/// ```
#[unstable(feature = "nonzero_ops", issue = "84186")]
#[stable(feature = "nonzero_checked_ops", since = "1.64.0")]
#[rustc_const_stable(feature = "const_nonzero_checked_ops", since = "1.64.0")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@@ -746,7 +746,6 @@ impl $Ty {
/// # Examples
///
/// ```
/// #![feature(nonzero_ops)]
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
/// # fn main() { test().unwrap(); }
@@ -761,7 +760,8 @@ impl $Ty {
/// # Some(())
/// # }
/// ```
#[unstable(feature = "nonzero_ops", issue = "84186")]
#[stable(feature = "nonzero_checked_ops", since = "1.64.0")]
#[rustc_const_stable(feature = "const_nonzero_checked_ops", since = "1.64.0")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@@ -782,7 +782,6 @@ pub const fn checked_mul(self, other: $Ty) -> Option<$Ty> {
/// # Examples
///
/// ```
/// #![feature(nonzero_ops)]
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
/// # fn main() { test().unwrap(); }
@@ -797,7 +796,8 @@ pub const fn checked_mul(self, other: $Ty) -> Option<$Ty> {
/// # Some(())
/// # }
/// ```
#[unstable(feature = "nonzero_ops", issue = "84186")]
#[stable(feature = "nonzero_checked_ops", since = "1.64.0")]
#[rustc_const_stable(feature = "const_nonzero_checked_ops", since = "1.64.0")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@@ -855,7 +855,6 @@ pub const fn saturating_mul(self, other: $Ty) -> $Ty {
/// # Examples
///
/// ```
/// #![feature(nonzero_ops)]
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
/// # fn main() { test().unwrap(); }
@@ -870,7 +869,8 @@ pub const fn saturating_mul(self, other: $Ty) -> $Ty {
/// # Some(())
/// # }
/// ```
#[unstable(feature = "nonzero_ops", issue = "84186")]
#[stable(feature = "nonzero_checked_ops", since = "1.64.0")]
#[rustc_const_stable(feature = "const_nonzero_checked_ops", since = "1.64.0")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
@@ -899,7 +899,6 @@ pub const fn checked_pow(self, other: u32) -> Option<$Ty> {
/// # Examples
///
/// ```
/// #![feature(nonzero_ops)]
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
///
/// # fn main() { test().unwrap(); }
@@ -914,7 +913,8 @@ pub const fn checked_pow(self, other: u32) -> Option<$Ty> {
/// # Some(())
/// # }
/// ```
#[unstable(feature = "nonzero_ops", issue = "84186")]
#[stable(feature = "nonzero_checked_ops", since = "1.64.0")]
#[rustc_const_stable(feature = "const_nonzero_checked_ops", since = "1.64.0")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]