Skip to content

Commit

Permalink
Remove unstable deprecated num::NonZeroI* types
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Mar 28, 2018
1 parent 8adea83 commit d43ca37
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
18 changes: 1 addition & 17 deletions src/libcore/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ macro_rules! impl_nonzero_fmt {
( #[$stability: meta] ( $( $Trait: ident ),+ ) for $Ty: ident ) => {
$(
#[$stability]
#[allow(deprecated)]
impl fmt::$Trait for $Ty {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand All @@ -35,7 +34,7 @@ macro_rules! impl_nonzero_fmt {
}

macro_rules! nonzero_integers {
( #[$stability: meta] #[$deprecation: meta] $( $Ty: ident($Int: ty); )+ ) => {
( #[$stability: meta] $( $Ty: ident($Int: ty); )+ ) => {
$(
/// An integer that is known not to equal zero.
///
Expand All @@ -47,7 +46,6 @@ macro_rules! nonzero_integers {
/// assert_eq!(size_of::<Option<std::num::NonZeroU32>>(), size_of::<u32>());
/// ```
#[$stability]
#[$deprecation]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct $Ty(NonZero<$Int>);

Expand Down Expand Up @@ -93,7 +91,6 @@ macro_rules! nonzero_integers {

nonzero_integers! {
#[unstable(feature = "nonzero", issue = "49137")]
#[allow(deprecated)] // Redundant, works around "error: inconsistent lockstep iteration"
NonZeroU8(u8);
NonZeroU16(u16);
NonZeroU32(u32);
Expand All @@ -102,19 +99,6 @@ nonzero_integers! {
NonZeroUsize(usize);
}

nonzero_integers! {
#[unstable(feature = "nonzero", issue = "49137")]
#[rustc_deprecated(since = "1.26.0", reason = "\
signed non-zero integers are considered for removal due to lack of known use cases. \
If you’re using them, please comment on https://github.com/serde-rs/serde/pull/1191")]
NonZeroI8(i8);
NonZeroI16(i16);
NonZeroI32(i32);
NonZeroI64(i64);
NonZeroI128(i128);
NonZeroIsize(isize);
}

/// Provides intentionally-wrapped arithmetic on `T`.
///
/// Operations like `+` on `u32` values is intended to never overflow,
Expand Down
5 changes: 1 addition & 4 deletions src/libstd/num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ pub use core::num::Wrapping;

#[unstable(feature = "nonzero", issue = "49137")]
#[allow(deprecated)]
pub use core::num::{
NonZeroU8, NonZeroI8, NonZeroU16, NonZeroI16, NonZeroU32, NonZeroI32,
NonZeroU64, NonZeroI64, NonZeroU128, NonZeroI128, NonZeroUsize, NonZeroIsize,
};
pub use core::num::{NonZeroU8, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU128, NonZeroUsize};

#[cfg(test)] use fmt;
#[cfg(test)] use ops::{Add, Sub, Mul, Div, Rem};
Expand Down

0 comments on commit d43ca37

Please sign in to comment.