Skip to content

Commit be43565

Browse files
committed
Deprecate NonZero type aliases.
1 parent 378a43a commit be43565

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

library/core/src/num/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,11 @@ pub use nonzero::ZeroablePrimitive;
7171
pub use nonzero::NonZero;
7272

7373
#[stable(feature = "signed_nonzero", since = "1.34.0")]
74+
#[allow(deprecated, deprecated_in_future)]
7475
pub use nonzero::{NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroIsize};
7576

7677
#[stable(feature = "nonzero", since = "1.28.0")]
78+
#[allow(deprecated, deprecated_in_future)]
7779
pub use nonzero::{NonZeroU128, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize};
7880

7981
#[stable(feature = "try_from", since = "1.34.0")]

library/core/src/num/nonzero.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,7 @@ macro_rules! nonzero_integer {
490490
///
491491
/// [null pointer optimization]: crate::option#representation
492492
#[$stability]
493+
#[deprecated(since = "TBD", note = "replaced by the generic `NonZero` type")]
493494
pub type $Ty = NonZero<$Int>;
494495

495496
impl $Ty {

library/std/src/num.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ pub use core::num::ZeroablePrimitive;
2727
pub use core::num::NonZero;
2828

2929
#[stable(feature = "signed_nonzero", since = "1.34.0")]
30+
#[allow(deprecated, deprecated_in_future)]
3031
pub use core::num::{NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroIsize};
3132

3233
#[stable(feature = "nonzero", since = "1.28.0")]
34+
#[allow(deprecated, deprecated_in_future)]
3335
pub use core::num::{NonZeroU128, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize};
3436

3537
#[stable(feature = "int_error_matching", since = "1.55.0")]

0 commit comments

Comments
 (0)