diff options
| author | Linus Färnstrand <faern@faern.net> | 2020-02-04 18:56:04 +0100 |
|---|---|---|
| committer | Linus Färnstrand <faern@faern.net> | 2020-02-12 20:20:56 +0100 |
| commit | 847a0dd845dbc74b4d49adf873c585519e356b4e (patch) | |
| tree | f740c77ac037431376f7ae10a3192eb8e63ddd6b | |
| parent | 5e17f31d94a0e2f1e69d5c4bd5171cf48ff9e5b0 (diff) | |
| download | rust-847a0dd845dbc74b4d49adf873c585519e356b4e.tar.gz rust-847a0dd845dbc74b4d49adf873c585519e356b4e.zip | |
Remove uint_macros that was identical to int_macros
| -rw-r--r-- | src/libcore/lib.rs | 4 | ||||
| -rw-r--r-- | src/libcore/num/int_macros.rs | 7 | ||||
| -rw-r--r-- | src/libcore/num/u128.rs | 2 | ||||
| -rw-r--r-- | src/libcore/num/u16.rs | 2 | ||||
| -rw-r--r-- | src/libcore/num/u32.rs | 2 | ||||
| -rw-r--r-- | src/libcore/num/u64.rs | 2 | ||||
| -rw-r--r-- | src/libcore/num/u8.rs | 2 | ||||
| -rw-r--r-- | src/libcore/num/uint_macros.rs | 35 | ||||
| -rw-r--r-- | src/libcore/num/usize.rs | 2 |
9 files changed, 13 insertions, 45 deletions
diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 4c543f1173b..1cd3e413ecc 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 d3d6db5a768..b68a09e1131 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 7d1aa664de3..b9a83a55ced 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 34f80abaecc..b481755c8d3 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 5fd486f5466..7355b6c1986 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 044d238aea9..2da5f013f05 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 6747e6a0f6c..76d3d70d9e9 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 ff16a1f38d8..00000000000 --- 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 e3a5239d908..fe132575459 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 } |
