std: Stabilize the remaining wrapping_* functions

This commit stabilizes the remaining `wrapping_*` functions on the primitive
integer types as they follow the same conventions as other wrapping methods are
were likely just initially unstable to be conservative.
This commit is contained in:
Alex Crichton
2015-06-10 18:31:15 -07:00
parent 8797c9ec6e
commit cdb69e2747

View File

@@ -468,7 +468,7 @@ macro_rules! int_impl {
/// to `-MIN`, a positive value that is too large to represent /// to `-MIN`, a positive value that is too large to represent
/// in the type. In such a case, this function returns `MIN` /// in the type. In such a case, this function returns `MIN`
/// itself.. /// itself..
#[unstable(feature = "num_wrapping")] #[stable(feature = "num_wrapping", since = "1.2.0")]
#[inline(always)] #[inline(always)]
pub fn wrapping_div(self, rhs: Self) -> Self { pub fn wrapping_div(self, rhs: Self) -> Self {
self.overflowing_div(rhs).0 self.overflowing_div(rhs).0
@@ -481,7 +481,7 @@ macro_rules! int_impl {
/// implementation artifacts make `x % y` illegal for `MIN / /// implementation artifacts make `x % y` illegal for `MIN /
/// -1` on a signed type illegal (where `MIN` is the negative /// -1` on a signed type illegal (where `MIN` is the negative
/// minimal value). In such a case, this function returns `0`. /// minimal value). In such a case, this function returns `0`.
#[unstable(feature = "num_wrapping")] #[stable(feature = "num_wrapping", since = "1.2.0")]
#[inline(always)] #[inline(always)]
pub fn wrapping_rem(self, rhs: Self) -> Self { pub fn wrapping_rem(self, rhs: Self) -> Self {
self.overflowing_rem(rhs).0 self.overflowing_rem(rhs).0
@@ -495,7 +495,7 @@ macro_rules! int_impl {
/// negative minimal value for the type); this is a positive /// negative minimal value for the type); this is a positive
/// value that is too large to represent in the type. In such /// value that is too large to represent in the type. In such
/// a case, this function returns `MIN` itself. /// a case, this function returns `MIN` itself.
#[unstable(feature = "num_wrapping")] #[stable(feature = "num_wrapping", since = "1.2.0")]
#[inline(always)] #[inline(always)]
pub fn wrapping_neg(self) -> Self { pub fn wrapping_neg(self) -> Self {
self.overflowing_neg().0 self.overflowing_neg().0
@@ -504,7 +504,7 @@ macro_rules! int_impl {
/// Panic-free bitwise shift-left; yields `self << mask(rhs)`, /// Panic-free bitwise shift-left; yields `self << mask(rhs)`,
/// where `mask` removes any high-order bits of `rhs` that /// where `mask` removes any high-order bits of `rhs` that
/// would cause the shift to exceed the bitwidth of the type. /// would cause the shift to exceed the bitwidth of the type.
#[unstable(feature = "num_wrapping")] #[stable(feature = "num_wrapping", since = "1.2.0")]
#[inline(always)] #[inline(always)]
pub fn wrapping_shl(self, rhs: u32) -> Self { pub fn wrapping_shl(self, rhs: u32) -> Self {
self.overflowing_shl(rhs).0 self.overflowing_shl(rhs).0
@@ -513,7 +513,7 @@ macro_rules! int_impl {
/// Panic-free bitwise shift-left; yields `self >> mask(rhs)`, /// Panic-free bitwise shift-left; yields `self >> mask(rhs)`,
/// where `mask` removes any high-order bits of `rhs` that /// where `mask` removes any high-order bits of `rhs` that
/// would cause the shift to exceed the bitwidth of the type. /// would cause the shift to exceed the bitwidth of the type.
#[unstable(feature = "num_wrapping")] #[stable(feature = "num_wrapping", since = "1.2.0")]
#[inline(always)] #[inline(always)]
pub fn wrapping_shr(self, rhs: u32) -> Self { pub fn wrapping_shr(self, rhs: u32) -> Self {
self.overflowing_shr(rhs).0 self.overflowing_shr(rhs).0
@@ -1038,7 +1038,7 @@ macro_rules! uint_impl {
/// to `-MIN`, a positive value that is too large to represent /// to `-MIN`, a positive value that is too large to represent
/// in the type. In such a case, this function returns `MIN` /// in the type. In such a case, this function returns `MIN`
/// itself.. /// itself..
#[unstable(feature = "num_wrapping")] #[stable(feature = "num_wrapping", since = "1.2.0")]
#[inline(always)] #[inline(always)]
pub fn wrapping_div(self, rhs: Self) -> Self { pub fn wrapping_div(self, rhs: Self) -> Self {
self.overflowing_div(rhs).0 self.overflowing_div(rhs).0
@@ -1051,7 +1051,7 @@ macro_rules! uint_impl {
/// implementation artifacts make `x % y` illegal for `MIN / /// implementation artifacts make `x % y` illegal for `MIN /
/// -1` on a signed type illegal (where `MIN` is the negative /// -1` on a signed type illegal (where `MIN` is the negative
/// minimal value). In such a case, this function returns `0`. /// minimal value). In such a case, this function returns `0`.
#[unstable(feature = "num_wrapping")] #[stable(feature = "num_wrapping", since = "1.2.0")]
#[inline(always)] #[inline(always)]
pub fn wrapping_rem(self, rhs: Self) -> Self { pub fn wrapping_rem(self, rhs: Self) -> Self {
self.overflowing_rem(rhs).0 self.overflowing_rem(rhs).0
@@ -1065,7 +1065,7 @@ macro_rules! uint_impl {
/// negative minimal value for the type); this is a positive /// negative minimal value for the type); this is a positive
/// value that is too large to represent in the type. In such /// value that is too large to represent in the type. In such
/// a case, this function returns `MIN` itself. /// a case, this function returns `MIN` itself.
#[unstable(feature = "num_wrapping")] #[stable(feature = "num_wrapping", since = "1.2.0")]
#[inline(always)] #[inline(always)]
pub fn wrapping_neg(self) -> Self { pub fn wrapping_neg(self) -> Self {
self.overflowing_neg().0 self.overflowing_neg().0
@@ -1074,7 +1074,7 @@ macro_rules! uint_impl {
/// Panic-free bitwise shift-left; yields `self << mask(rhs)`, /// Panic-free bitwise shift-left; yields `self << mask(rhs)`,
/// where `mask` removes any high-order bits of `rhs` that /// where `mask` removes any high-order bits of `rhs` that
/// would cause the shift to exceed the bitwidth of the type. /// would cause the shift to exceed the bitwidth of the type.
#[unstable(feature = "num_wrapping")] #[stable(feature = "num_wrapping", since = "1.2.0")]
#[inline(always)] #[inline(always)]
pub fn wrapping_shl(self, rhs: u32) -> Self { pub fn wrapping_shl(self, rhs: u32) -> Self {
self.overflowing_shl(rhs).0 self.overflowing_shl(rhs).0
@@ -1083,7 +1083,7 @@ macro_rules! uint_impl {
/// Panic-free bitwise shift-left; yields `self >> mask(rhs)`, /// Panic-free bitwise shift-left; yields `self >> mask(rhs)`,
/// where `mask` removes any high-order bits of `rhs` that /// where `mask` removes any high-order bits of `rhs` that
/// would cause the shift to exceed the bitwidth of the type. /// would cause the shift to exceed the bitwidth of the type.
#[unstable(feature = "num_wrapping")] #[stable(feature = "num_wrapping", since = "1.2.0")]
#[inline(always)] #[inline(always)]
pub fn wrapping_shr(self, rhs: u32) -> Self { pub fn wrapping_shr(self, rhs: u32) -> Self {
self.overflowing_shr(rhs).0 self.overflowing_shr(rhs).0