提交 c536639c 编写于 作者: S Simon Sapin

Remove unstable deprecated num::NonZeroI* types

上级 ee85bfdc
......@@ -24,7 +24,6 @@
( #[$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 {
......@@ -36,7 +35,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
}
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.
///
......@@ -48,7 +47,6 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
/// 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>);
......@@ -94,7 +92,6 @@ pub fn get(self) -> $Int {
nonzero_integers! {
#[unstable(feature = "nonzero", issue = "49137")]
#[allow(deprecated)] // Redundant, works around "error: inconsistent lockstep iteration"
NonZeroU8(u8);
NonZeroU16(u16);
NonZeroU32(u32);
......@@ -103,19 +100,6 @@ pub fn get(self) -> $Int {
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/rust-lang/rust/issues/49137")]
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,
......
......@@ -23,10 +23,7 @@
#[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};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册