diff options
Diffstat (limited to '')
-rw-r--r-- | library/core/src/num/shells/i128.rs | 13 | ||||
-rw-r--r-- | library/core/src/num/shells/i16.rs | 13 | ||||
-rw-r--r-- | library/core/src/num/shells/i32.rs | 13 | ||||
-rw-r--r-- | library/core/src/num/shells/i64.rs | 13 | ||||
-rw-r--r-- | library/core/src/num/shells/i8.rs | 13 | ||||
-rw-r--r-- | library/core/src/num/shells/int_macros.rs | 44 | ||||
-rw-r--r-- | library/core/src/num/shells/isize.rs | 13 | ||||
-rw-r--r-- | library/core/src/num/shells/u128.rs | 13 | ||||
-rw-r--r-- | library/core/src/num/shells/u16.rs | 13 | ||||
-rw-r--r-- | library/core/src/num/shells/u32.rs | 13 | ||||
-rw-r--r-- | library/core/src/num/shells/u64.rs | 13 | ||||
-rw-r--r-- | library/core/src/num/shells/u8.rs | 13 | ||||
-rw-r--r-- | library/core/src/num/shells/usize.rs | 13 |
13 files changed, 200 insertions, 0 deletions
diff --git a/library/core/src/num/shells/i128.rs b/library/core/src/num/shells/i128.rs new file mode 100644 index 000000000..7b048dc52 --- /dev/null +++ b/library/core/src/num/shells/i128.rs @@ -0,0 +1,13 @@ +//! Constants for the 128-bit signed integer type. +//! +//! *[See also the `i128` primitive type][i128].* +//! +//! New code should use the associated constants directly on the primitive type. + +#![stable(feature = "i128", since = "1.26.0")] +#![deprecated( + since = "TBD", + note = "all constants in this module replaced by associated constants on `i128`" +)] + +int_module! { i128, #[stable(feature = "i128", since="1.26.0")] } diff --git a/library/core/src/num/shells/i16.rs b/library/core/src/num/shells/i16.rs new file mode 100644 index 000000000..5c5812d5c --- /dev/null +++ b/library/core/src/num/shells/i16.rs @@ -0,0 +1,13 @@ +//! Constants for the 16-bit signed integer type. +//! +//! *[See also the `i16` primitive type][i16].* +//! +//! New code should use the associated constants directly on the primitive type. + +#![stable(feature = "rust1", since = "1.0.0")] +#![deprecated( + since = "TBD", + note = "all constants in this module replaced by associated constants on `i16`" +)] + +int_module! { i16 } diff --git a/library/core/src/num/shells/i32.rs b/library/core/src/num/shells/i32.rs new file mode 100644 index 000000000..b283ac644 --- /dev/null +++ b/library/core/src/num/shells/i32.rs @@ -0,0 +1,13 @@ +//! Constants for the 32-bit signed integer type. +//! +//! *[See also the `i32` primitive type][i32].* +//! +//! New code should use the associated constants directly on the primitive type. + +#![stable(feature = "rust1", since = "1.0.0")] +#![deprecated( + since = "TBD", + note = "all constants in this module replaced by associated constants on `i32`" +)] + +int_module! { i32 } diff --git a/library/core/src/num/shells/i64.rs b/library/core/src/num/shells/i64.rs new file mode 100644 index 000000000..a416fa7e9 --- /dev/null +++ b/library/core/src/num/shells/i64.rs @@ -0,0 +1,13 @@ +//! Constants for the 64-bit signed integer type. +//! +//! *[See also the `i64` primitive type][i64].* +//! +//! New code should use the associated constants directly on the primitive type. + +#![stable(feature = "rust1", since = "1.0.0")] +#![deprecated( + since = "TBD", + note = "all constants in this module replaced by associated constants on `i64`" +)] + +int_module! { i64 } diff --git a/library/core/src/num/shells/i8.rs b/library/core/src/num/shells/i8.rs new file mode 100644 index 000000000..02465013a --- /dev/null +++ b/library/core/src/num/shells/i8.rs @@ -0,0 +1,13 @@ +//! Constants for the 8-bit signed integer type. +//! +//! *[See also the `i8` primitive type][i8].* +//! +//! New code should use the associated constants directly on the primitive type. + +#![stable(feature = "rust1", since = "1.0.0")] +#![deprecated( + since = "TBD", + note = "all constants in this module replaced by associated constants on `i8`" +)] + +int_module! { i8 } diff --git a/library/core/src/num/shells/int_macros.rs b/library/core/src/num/shells/int_macros.rs new file mode 100644 index 000000000..2b1133e11 --- /dev/null +++ b/library/core/src/num/shells/int_macros.rs @@ -0,0 +1,44 @@ +#![doc(hidden)] + +macro_rules! int_module { + ($T:ident) => (int_module!($T, #[stable(feature = "rust1", since = "1.0.0")]);); + ($T:ident, #[$attr:meta]) => ( + #[doc = concat!( + "The smallest value that can be represented by this integer type. Use ", + "[`", stringify!($T), "::MIN", "`] instead." + )] + /// + /// # Examples + /// + /// ```rust + /// // deprecated way + #[doc = concat!("let min = std::", stringify!($T), "::MIN;")] + /// + /// // intended way + #[doc = concat!("let min = ", stringify!($T), "::MIN;")] + /// ``` + /// + #[$attr] + #[deprecated(since = "TBD", note = "replaced by the `MIN` associated constant on this type")] + pub const MIN: $T = $T::MIN; + + #[doc = concat!( + "The largest value that can be represented by this integer type. Use ", + "[`", stringify!($T), "::MAX", "`] instead." + )] + /// + /// # Examples + /// + /// ```rust + /// // deprecated way + #[doc = concat!("let max = std::", stringify!($T), "::MAX;")] + /// + /// // intended way + #[doc = concat!("let max = ", stringify!($T), "::MAX;")] + /// ``` + /// + #[$attr] + #[deprecated(since = "TBD", note = "replaced by the `MAX` associated constant on this type")] + pub const MAX: $T = $T::MAX; + ) +} diff --git a/library/core/src/num/shells/isize.rs b/library/core/src/num/shells/isize.rs new file mode 100644 index 000000000..1579fbab6 --- /dev/null +++ b/library/core/src/num/shells/isize.rs @@ -0,0 +1,13 @@ +//! Constants for the pointer-sized signed integer type. +//! +//! *[See also the `isize` primitive type][isize].* +//! +//! New code should use the associated constants directly on the primitive type. + +#![stable(feature = "rust1", since = "1.0.0")] +#![deprecated( + since = "TBD", + note = "all constants in this module replaced by associated constants on `isize`" +)] + +int_module! { isize } diff --git a/library/core/src/num/shells/u128.rs b/library/core/src/num/shells/u128.rs new file mode 100644 index 000000000..fe08cee58 --- /dev/null +++ b/library/core/src/num/shells/u128.rs @@ -0,0 +1,13 @@ +//! Constants for the 128-bit unsigned integer type. +//! +//! *[See also the `u128` primitive type][u128].* +//! +//! New code should use the associated constants directly on the primitive type. + +#![stable(feature = "i128", since = "1.26.0")] +#![deprecated( + since = "TBD", + note = "all constants in this module replaced by associated constants on `u128`" +)] + +int_module! { u128, #[stable(feature = "i128", since="1.26.0")] } diff --git a/library/core/src/num/shells/u16.rs b/library/core/src/num/shells/u16.rs new file mode 100644 index 000000000..36f8c6978 --- /dev/null +++ b/library/core/src/num/shells/u16.rs @@ -0,0 +1,13 @@ +//! Constants for the 16-bit unsigned integer type. +//! +//! *[See also the `u16` primitive type][u16].* +//! +//! New code should use the associated constants directly on the primitive type. + +#![stable(feature = "rust1", since = "1.0.0")] +#![deprecated( + since = "TBD", + note = "all constants in this module replaced by associated constants on `u16`" +)] + +int_module! { u16 } diff --git a/library/core/src/num/shells/u32.rs b/library/core/src/num/shells/u32.rs new file mode 100644 index 000000000..1c369097d --- /dev/null +++ b/library/core/src/num/shells/u32.rs @@ -0,0 +1,13 @@ +//! Constants for the 32-bit unsigned integer type. +//! +//! *[See also the `u32` primitive type][u32].* +//! +//! New code should use the associated constants directly on the primitive type. + +#![stable(feature = "rust1", since = "1.0.0")] +#![deprecated( + since = "TBD", + note = "all constants in this module replaced by associated constants on `u32`" +)] + +int_module! { u32 } diff --git a/library/core/src/num/shells/u64.rs b/library/core/src/num/shells/u64.rs new file mode 100644 index 000000000..e8b691d15 --- /dev/null +++ b/library/core/src/num/shells/u64.rs @@ -0,0 +1,13 @@ +//! Constants for the 64-bit unsigned integer type. +//! +//! *[See also the `u64` primitive type][u64].* +//! +//! New code should use the associated constants directly on the primitive type. + +#![stable(feature = "rust1", since = "1.0.0")] +#![deprecated( + since = "TBD", + note = "all constants in this module replaced by associated constants on `u64`" +)] + +int_module! { u64 } diff --git a/library/core/src/num/shells/u8.rs b/library/core/src/num/shells/u8.rs new file mode 100644 index 000000000..817c6a18a --- /dev/null +++ b/library/core/src/num/shells/u8.rs @@ -0,0 +1,13 @@ +//! Constants for the 8-bit unsigned integer type. +//! +//! *[See also the `u8` primitive type][u8].* +//! +//! New code should use the associated constants directly on the primitive type. + +#![stable(feature = "rust1", since = "1.0.0")] +#![deprecated( + since = "TBD", + note = "all constants in this module replaced by associated constants on `u8`" +)] + +int_module! { u8 } diff --git a/library/core/src/num/shells/usize.rs b/library/core/src/num/shells/usize.rs new file mode 100644 index 000000000..3e1bec5ec --- /dev/null +++ b/library/core/src/num/shells/usize.rs @@ -0,0 +1,13 @@ +//! Constants for the pointer-sized unsigned integer type. +//! +//! *[See also the `usize` primitive type][usize].* +//! +//! New code should use the associated constants directly on the primitive type. + +#![stable(feature = "rust1", since = "1.0.0")] +#![deprecated( + since = "TBD", + note = "all constants in this module replaced by associated constants on `usize`" +)] + +int_module! { usize } |