Stabilize #![feature(mixed_integer_ops)]
This commit is contained in:
parent
c2804e6ec2
commit
5510a69981
4 changed files with 24 additions and 38 deletions
|
@ -464,12 +464,11 @@ macro_rules! int_impl {
|
|||
/// Basic usage:
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(mixed_integer_ops)]
|
||||
#[doc = concat!("assert_eq!(1", stringify!($SelfT), ".checked_add_unsigned(2), Some(3));")]
|
||||
#[doc = concat!("assert_eq!((", stringify!($SelfT), "::MAX - 2).checked_add_unsigned(3), None);")]
|
||||
/// ```
|
||||
#[unstable(feature = "mixed_integer_ops", issue = "87840")]
|
||||
#[rustc_const_unstable(feature = "mixed_integer_ops", issue = "87840")]
|
||||
#[stable(feature = "mixed_integer_ops", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[rustc_const_stable(feature = "mixed_integer_ops", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[inline]
|
||||
|
@ -533,12 +532,11 @@ macro_rules! int_impl {
|
|||
/// Basic usage:
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(mixed_integer_ops)]
|
||||
#[doc = concat!("assert_eq!(1", stringify!($SelfT), ".checked_sub_unsigned(2), Some(-1));")]
|
||||
#[doc = concat!("assert_eq!((", stringify!($SelfT), "::MIN + 2).checked_sub_unsigned(3), None);")]
|
||||
/// ```
|
||||
#[unstable(feature = "mixed_integer_ops", issue = "87840")]
|
||||
#[rustc_const_unstable(feature = "mixed_integer_ops", issue = "87840")]
|
||||
#[stable(feature = "mixed_integer_ops", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[rustc_const_stable(feature = "mixed_integer_ops", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[inline]
|
||||
|
@ -907,12 +905,11 @@ macro_rules! int_impl {
|
|||
/// Basic usage:
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(mixed_integer_ops)]
|
||||
#[doc = concat!("assert_eq!(1", stringify!($SelfT), ".saturating_add_unsigned(2), 3);")]
|
||||
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MAX.saturating_add_unsigned(100), ", stringify!($SelfT), "::MAX);")]
|
||||
/// ```
|
||||
#[unstable(feature = "mixed_integer_ops", issue = "87840")]
|
||||
#[rustc_const_unstable(feature = "mixed_integer_ops", issue = "87840")]
|
||||
#[stable(feature = "mixed_integer_ops", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[rustc_const_stable(feature = "mixed_integer_ops", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[inline]
|
||||
|
@ -954,12 +951,11 @@ macro_rules! int_impl {
|
|||
/// Basic usage:
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(mixed_integer_ops)]
|
||||
#[doc = concat!("assert_eq!(100", stringify!($SelfT), ".saturating_sub_unsigned(127), -27);")]
|
||||
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.saturating_sub_unsigned(100), ", stringify!($SelfT), "::MIN);")]
|
||||
/// ```
|
||||
#[unstable(feature = "mixed_integer_ops", issue = "87840")]
|
||||
#[rustc_const_unstable(feature = "mixed_integer_ops", issue = "87840")]
|
||||
#[stable(feature = "mixed_integer_ops", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[rustc_const_stable(feature = "mixed_integer_ops", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[inline]
|
||||
|
@ -1135,12 +1131,11 @@ macro_rules! int_impl {
|
|||
/// Basic usage:
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(mixed_integer_ops)]
|
||||
#[doc = concat!("assert_eq!(100", stringify!($SelfT), ".wrapping_add_unsigned(27), 127);")]
|
||||
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MAX.wrapping_add_unsigned(2), ", stringify!($SelfT), "::MIN + 1);")]
|
||||
/// ```
|
||||
#[unstable(feature = "mixed_integer_ops", issue = "87840")]
|
||||
#[rustc_const_unstable(feature = "mixed_integer_ops", issue = "87840")]
|
||||
#[stable(feature = "mixed_integer_ops", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[rustc_const_stable(feature = "mixed_integer_ops", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[inline(always)]
|
||||
|
@ -1176,12 +1171,11 @@ macro_rules! int_impl {
|
|||
/// Basic usage:
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(mixed_integer_ops)]
|
||||
#[doc = concat!("assert_eq!(0", stringify!($SelfT), ".wrapping_sub_unsigned(127), -127);")]
|
||||
#[doc = concat!("assert_eq!((-2", stringify!($SelfT), ").wrapping_sub_unsigned(", stringify!($UnsignedT), "::MAX), -1);")]
|
||||
/// ```
|
||||
#[unstable(feature = "mixed_integer_ops", issue = "87840")]
|
||||
#[rustc_const_unstable(feature = "mixed_integer_ops", issue = "87840")]
|
||||
#[stable(feature = "mixed_integer_ops", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[rustc_const_stable(feature = "mixed_integer_ops", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[inline(always)]
|
||||
|
@ -1529,13 +1523,12 @@ macro_rules! int_impl {
|
|||
/// Basic usage:
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(mixed_integer_ops)]
|
||||
#[doc = concat!("assert_eq!(1", stringify!($SelfT), ".overflowing_add_unsigned(2), (3, false));")]
|
||||
#[doc = concat!("assert_eq!((", stringify!($SelfT), "::MIN).overflowing_add_unsigned(", stringify!($UnsignedT), "::MAX), (", stringify!($SelfT), "::MAX, false));")]
|
||||
#[doc = concat!("assert_eq!((", stringify!($SelfT), "::MAX - 2).overflowing_add_unsigned(3), (", stringify!($SelfT), "::MIN, true));")]
|
||||
/// ```
|
||||
#[unstable(feature = "mixed_integer_ops", issue = "87840")]
|
||||
#[rustc_const_unstable(feature = "mixed_integer_ops", issue = "87840")]
|
||||
#[stable(feature = "mixed_integer_ops", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[rustc_const_stable(feature = "mixed_integer_ops", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[inline]
|
||||
|
@ -1580,13 +1573,12 @@ macro_rules! int_impl {
|
|||
/// Basic usage:
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(mixed_integer_ops)]
|
||||
#[doc = concat!("assert_eq!(1", stringify!($SelfT), ".overflowing_sub_unsigned(2), (-1, false));")]
|
||||
#[doc = concat!("assert_eq!((", stringify!($SelfT), "::MAX).overflowing_sub_unsigned(", stringify!($UnsignedT), "::MAX), (", stringify!($SelfT), "::MIN, false));")]
|
||||
#[doc = concat!("assert_eq!((", stringify!($SelfT), "::MIN + 2).overflowing_sub_unsigned(3), (", stringify!($SelfT), "::MAX, true));")]
|
||||
/// ```
|
||||
#[unstable(feature = "mixed_integer_ops", issue = "87840")]
|
||||
#[rustc_const_unstable(feature = "mixed_integer_ops", issue = "87840")]
|
||||
#[stable(feature = "mixed_integer_ops", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[rustc_const_stable(feature = "mixed_integer_ops", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue