From 847a0dd845dbc74b4d49adf873c585519e356b4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20F=C3=A4rnstrand?= Date: Tue, 4 Feb 2020 18:56:04 +0100 Subject: [PATCH] Remove uint_macros that was identical to int_macros --- src/libcore/lib.rs | 4 ---- src/libcore/num/int_macros.rs | 7 +++++++ src/libcore/num/u128.rs | 2 +- src/libcore/num/u16.rs | 2 +- src/libcore/num/u32.rs | 2 +- src/libcore/num/u64.rs | 2 +- src/libcore/num/u8.rs | 2 +- src/libcore/num/uint_macros.rs | 35 ---------------------------------- src/libcore/num/usize.rs | 2 +- 9 files changed, 13 insertions(+), 45 deletions(-) delete mode 100644 src/libcore/num/uint_macros.rs diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 4c543f1173bb..1cd3e413ecc3 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -155,10 +155,6 @@ mod internal_macros; #[macro_use] mod int_macros; -#[path = "num/uint_macros.rs"] -#[macro_use] -mod uint_macros; - #[path = "num/i128.rs"] pub mod i128; #[path = "num/i16.rs"] diff --git a/src/libcore/num/int_macros.rs b/src/libcore/num/int_macros.rs index d3d6db5a7687..b68a09e11318 100644 --- a/src/libcore/num/int_macros.rs +++ b/src/libcore/num/int_macros.rs @@ -1,5 +1,12 @@ #![doc(hidden)] +macro_rules! doc_comment { + ($x:expr, $($tt:tt)*) => { + #[doc = $x] + $($tt)* + }; +} + macro_rules! int_module { ($T:ident) => (int_module!($T, #[stable(feature = "rust1", since = "1.0.0")]);); ($T:ident, #[$attr:meta]) => ( diff --git a/src/libcore/num/u128.rs b/src/libcore/num/u128.rs index 7d1aa664de30..b9a83a55ced4 100644 --- a/src/libcore/num/u128.rs +++ b/src/libcore/num/u128.rs @@ -3,4 +3,4 @@ //! *[See also the `u128` primitive type](../../std/primitive.u128.html).* #![stable(feature = "i128", since = "1.26.0")] -uint_module! { u128, #[stable(feature = "i128", since="1.26.0")] } +int_module! { u128, #[stable(feature = "i128", since="1.26.0")] } diff --git a/src/libcore/num/u16.rs b/src/libcore/num/u16.rs index 34f80abaecc0..b481755c8d35 100644 --- a/src/libcore/num/u16.rs +++ b/src/libcore/num/u16.rs @@ -4,4 +4,4 @@ #![stable(feature = "rust1", since = "1.0.0")] -uint_module! { u16 } +int_module! { u16 } diff --git a/src/libcore/num/u32.rs b/src/libcore/num/u32.rs index 5fd486f54660..7355b6c19867 100644 --- a/src/libcore/num/u32.rs +++ b/src/libcore/num/u32.rs @@ -4,4 +4,4 @@ #![stable(feature = "rust1", since = "1.0.0")] -uint_module! { u32 } +int_module! { u32 } diff --git a/src/libcore/num/u64.rs b/src/libcore/num/u64.rs index 044d238aea9b..2da5f013f054 100644 --- a/src/libcore/num/u64.rs +++ b/src/libcore/num/u64.rs @@ -4,4 +4,4 @@ #![stable(feature = "rust1", since = "1.0.0")] -uint_module! { u64 } +int_module! { u64 } diff --git a/src/libcore/num/u8.rs b/src/libcore/num/u8.rs index 6747e6a0f6c2..76d3d70d9e99 100644 --- a/src/libcore/num/u8.rs +++ b/src/libcore/num/u8.rs @@ -4,4 +4,4 @@ #![stable(feature = "rust1", since = "1.0.0")] -uint_module! { u8 } +int_module! { u8 } diff --git a/src/libcore/num/uint_macros.rs b/src/libcore/num/uint_macros.rs deleted file mode 100644 index ff16a1f38d8a..000000000000 --- a/src/libcore/num/uint_macros.rs +++ /dev/null @@ -1,35 +0,0 @@ -#![doc(hidden)] - -macro_rules! doc_comment { - ($x:expr, $($tt:tt)*) => { - #[doc = $x] - $($tt)* - }; -} - -macro_rules! uint_module { - ($T:ident) => (uint_module!($T, #[stable(feature = "rust1", since = "1.0.0")]);); - ($T:ident, #[$attr:meta]) => ( - doc_comment! { - concat!("**This method is soft-deprecated.** - - Although using it won’t cause compilation warning, - new code should use [`", stringify!($T), "::MIN", "`] instead. - - The smallest value that can be represented by this integer type."), - #[$attr] - pub const MIN: $T = $T::min_value(); - } - - doc_comment! { - concat!("**This method is soft-deprecated.** - - Although using it won’t cause compilation warning, - new code should use [`", stringify!($T), "::MAX", "`] instead. - - The largest value that can be represented by this integer type."), - #[$attr] - pub const MAX: $T = $T::max_value(); - } - ) -} diff --git a/src/libcore/num/usize.rs b/src/libcore/num/usize.rs index e3a5239d908d..fe1325754598 100644 --- a/src/libcore/num/usize.rs +++ b/src/libcore/num/usize.rs @@ -4,4 +4,4 @@ #![stable(feature = "rust1", since = "1.0.0")] -uint_module! { usize } +int_module! { usize }