Rename debug! macro to impl_Debug!

This commit is contained in:
zlfn 2024-10-15 18:32:21 +09:00
parent 918dc38733
commit 0637517da6

View File

@ -167,7 +167,8 @@ macro_rules! integer {
integer! { i32, u32 }
integer! { i64, u64 }
integer! { i128, u128 }
macro_rules! debug {
macro_rules! impl_Debug {
($($T:ident)*) => {$(
#[stable(feature = "rust1", since = "1.0.0")]
impl fmt::Debug for $T {
@ -184,10 +185,6 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
}
)*};
}
debug! {
i8 i16 i32 i64 i128 isize
u8 u16 u32 u64 u128 usize
}
// 2 digit decimal look up table
static DEC_DIGITS_LUT: &[u8; 200] = b"0001020304050607080910111213141516171819\
@ -510,6 +507,11 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
};
}
impl_Debug! {
i8 i16 i32 i64 i128 isize
u8 u16 u32 u64 u128 usize
}
// Include wasm32 in here since it doesn't reflect the native pointer size, and
// often cares strongly about getting a smaller code size.
#[cfg(any(target_pointer_width = "64", target_arch = "wasm32"))]