Remove uint_macros that was identical to int_macros

This commit is contained in:
Linus Färnstrand
2020-02-04 18:56:04 +01:00
parent 5e17f31d94
commit 847a0dd845
9 changed files with 13 additions and 45 deletions

View File

@@ -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"]

View File

@@ -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]) => (

View File

@@ -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")] }

View File

@@ -4,4 +4,4 @@
#![stable(feature = "rust1", since = "1.0.0")]
uint_module! { u16 }
int_module! { u16 }

View File

@@ -4,4 +4,4 @@
#![stable(feature = "rust1", since = "1.0.0")]
uint_module! { u32 }
int_module! { u32 }

View File

@@ -4,4 +4,4 @@
#![stable(feature = "rust1", since = "1.0.0")]
uint_module! { u64 }
int_module! { u64 }

View File

@@ -4,4 +4,4 @@
#![stable(feature = "rust1", since = "1.0.0")]
uint_module! { u8 }
int_module! { u8 }

View File

@@ -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 wont 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 wont 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();
}
)
}

View File

@@ -4,4 +4,4 @@
#![stable(feature = "rust1", since = "1.0.0")]
uint_module! { usize }
int_module! { usize }