]> git.lizzy.rs Git - rust.git/commitdiff
Removed module macro workaround for signed and unsigned integers
authorMarvin Löbel <loebel.marvin@gmail.com>
Fri, 29 Nov 2013 19:30:31 +0000 (20:30 +0100)
committerMarvin Löbel <loebel.marvin@gmail.com>
Fri, 29 Nov 2013 19:36:47 +0000 (20:36 +0100)
12 files changed:
src/libstd/num/i16.rs
src/libstd/num/i32.rs
src/libstd/num/i64.rs
src/libstd/num/i8.rs
src/libstd/num/int.rs
src/libstd/num/int_macros.rs
src/libstd/num/u16.rs
src/libstd/num/u32.rs
src/libstd/num/u64.rs
src/libstd/num/u8.rs
src/libstd/num/uint.rs
src/libstd/num/uint_macros.rs

index 5c077c7e633d0cc16caa38fbc4ad810bb0a50a1f..fcf1f24d0e4555e8192a5150906c8dbcd549c037 100644 (file)
 
 //! Operations and constants for `i16`
 
+#[allow(non_uppercase_statics)];
+
+use prelude::*;
+
+use default::Default;
 use num::{BitCount, CheckedAdd, CheckedSub, CheckedMul};
+use num::{CheckedDiv, Zero, One, strconv};
+use num::{ToStrRadix, FromStrRadix};
 use option::{Option, Some, None};
+use str;
 use unstable::intrinsics;
 
-pub use self::generated::*;
-
 int_module!(i16, 16)
 
 impl BitCount for i16 {
index f076e33b3a2183808cbe533378380d174cee4500..385e1c91ca503005014e7ec5da0b091db489aa33 100644 (file)
 
 //! Operations and constants for `i32`
 
+#[allow(non_uppercase_statics)];
+
+use prelude::*;
+
+use default::Default;
 use num::{BitCount, CheckedAdd, CheckedSub, CheckedMul};
+use num::{CheckedDiv, Zero, One, strconv};
+use num::{ToStrRadix, FromStrRadix};
 use option::{Option, Some, None};
+use str;
 use unstable::intrinsics;
 
-pub use self::generated::*;
-
 int_module!(i32, 32)
 
 impl BitCount for i32 {
index d991bf0330034a7e387280208e51c4d646d41e81..f6b369b1312a5ec494125cc991e0ae175f8017a5 100644 (file)
 
 //! Operations and constants for `i64`
 
-use num::{BitCount, CheckedAdd, CheckedSub};
+#[allow(non_uppercase_statics)];
+
+use prelude::*;
+
+use default::Default;
 #[cfg(target_word_size = "64")]
 use num::CheckedMul;
+use num::{BitCount, CheckedAdd, CheckedSub};
+use num::{CheckedDiv, Zero, One, strconv};
+use num::{ToStrRadix, FromStrRadix};
 use option::{Option, Some, None};
+use str;
 use unstable::intrinsics;
 
-pub use self::generated::*;
-
 int_module!(i64, 64)
 
 impl BitCount for i64 {
index a807f6b9e53f3dbd9d5cd9fcdf6f61fc07fc995b..9de90ca4657d1147388fb4f8b79c5a87e02eedf6 100644 (file)
 
 //! Operations and constants for `i8`
 
+#[allow(non_uppercase_statics)];
+
+use prelude::*;
+
+use default::Default;
 use num::{BitCount, CheckedAdd, CheckedSub, CheckedMul};
+use num::{CheckedDiv, Zero, One, strconv};
+use num::{ToStrRadix, FromStrRadix};
 use option::{Option, Some, None};
+use str;
 use unstable::intrinsics;
 
-pub use self::generated::*;
-
 int_module!(i8, 8)
 
 impl BitCount for i8 {
index c5364fa3dab963d652d80b5f477f4b1138dacb3f..517bd45e45bd1b51d9d64554ea6e9908db96955d 100644 (file)
 
 #[allow(non_uppercase_statics)];
 
+use prelude::*;
+
+use default::Default;
 use num::{BitCount, CheckedAdd, CheckedSub, CheckedMul};
+use num::{CheckedDiv, Zero, One, strconv};
+use num::{ToStrRadix, FromStrRadix};
 use option::{Option, Some, None};
+use str;
 use unstable::intrinsics;
 
-pub use self::generated::*;
-
-#[cfg(target_word_size = "32")] pub static bits: uint = 32;
-#[cfg(target_word_size = "64")] pub static bits: uint = 64;
-
-int_module!(int, super::bits)
+#[cfg(target_word_size = "32")] int_module!(int, 32)
+#[cfg(target_word_size = "64")] int_module!(int, 64)
 
 #[cfg(target_word_size = "32")]
 impl BitCount for int {
index 07893087628c1f1bd04428dad12f431bba6e8b89..8c60b0ec75a694cb841cf92ac34d7334dcca0cc9 100644 (file)
@@ -8,22 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// FIXME(#4375):  This shouldn't have to be a nested module named 'generated'...
-// FIXME(#10716): ... but now that we could solve that, the import lines and
-//                attributes still prevent a removal of that module.
-
 #[macro_escape];
 #[doc(hidden)];
 
-macro_rules! int_module (($T:ty, $bits:expr) => (mod generated {
-
-#[allow(non_uppercase_statics)];
-
-use default::Default;
-use num::{ToStrRadix, FromStrRadix};
-use num::{CheckedDiv, Zero, One, strconv};
-use prelude::*;
-use str;
+macro_rules! int_module (($T:ty, $bits:expr) => (
 
 pub static bits : uint = $bits;
 pub static bytes : uint = ($bits / 8);
@@ -781,4 +769,4 @@ fn test_signed_checked_div() {
     }
 }
 
-}))
+))
index e227947ca6e5f8d2f60ecf5a97459fc4f2c6e4c5..ed8ec3b6c54b919230c2c34beb7ab73521eee254 100644 (file)
 
 //! Operations and constants for `u16`
 
+#[allow(non_uppercase_statics)];
+
+use prelude::*;
+
+use default::Default;
+use num::BitCount;
 use num::{CheckedAdd, CheckedSub, CheckedMul};
+use num::{CheckedDiv, Zero, One, strconv};
+use num::{ToStrRadix, FromStrRadix};
 use option::{Option, Some, None};
+use str;
 use unstable::intrinsics;
 
-pub use self::generated::*;
-
 uint_module!(u16, i16, 16)
 
 impl CheckedAdd for u16 {
index 4dbd543da7b0b252f71a881df0bc3a948ac33506..2977549803384b5562e87227cc607425ca59a5dc 100644 (file)
 
 //! Operations and constants for `u32`
 
+#[allow(non_uppercase_statics)];
+
+use prelude::*;
+
+use default::Default;
+use num::BitCount;
 use num::{CheckedAdd, CheckedSub, CheckedMul};
+use num::{CheckedDiv, Zero, One, strconv};
+use num::{ToStrRadix, FromStrRadix};
 use option::{Option, Some, None};
+use str;
 use unstable::intrinsics;
 
-pub use self::generated::*;
-
 uint_module!(u32, i32, 32)
 
 impl CheckedAdd for u32 {
index d3077333077d3f65ecf2e3530dce3617f093a869..dc43801eb3958b43fef8ea47e0e94286b2fec650 100644 (file)
 
 //! Operations and constants for `u64`
 
-use num::{CheckedAdd, CheckedSub};
+#[allow(non_uppercase_statics)];
+
+use prelude::*;
+
+use default::Default;
+use num::BitCount;
 #[cfg(target_word_size = "64")]
 use num::CheckedMul;
+use num::{CheckedAdd, CheckedSub};
+use num::{CheckedDiv, Zero, One, strconv};
+use num::{ToStrRadix, FromStrRadix};
 use option::{Option, Some, None};
+use str;
 use unstable::intrinsics;
 
-pub use self::generated::*;
-
 uint_module!(u64, i64, 64)
 
 impl CheckedAdd for u64 {
index ca54af5cecc43808fc85a2131005a96bb962e9f8..12ad4efdbd5d1d4197f00fb89ba6fe5cc9e6b1d3 100644 (file)
 
 //! Operations and constants for `u8`
 
+#[allow(non_uppercase_statics)];
+
+use prelude::*;
+
+use default::Default;
+use num::BitCount;
 use num::{CheckedAdd, CheckedSub, CheckedMul};
+use num::{CheckedDiv, Zero, One, strconv};
+use num::{ToStrRadix, FromStrRadix};
 use option::{Option, Some, None};
+use str;
 use unstable::intrinsics;
 
-pub use self::generated::*;
-
 uint_module!(u8, i8, 8)
 
 impl CheckedAdd for u8 {
index cf28083bb09b941d6106614d85e3f3cbd113d299..549490050c590d412c3d70608ee05e44aca57132 100644 (file)
 
 //! Operations and constants for `uint`
 
-use num;
+#[allow(non_uppercase_statics)];
+
+use prelude::*;
+
+use default::Default;
+use mem;
+use num::BitCount;
 use num::{CheckedAdd, CheckedSub, CheckedMul};
+use num::{CheckedDiv, Zero, One, strconv};
+use num::{ToStrRadix, FromStrRadix};
+use num;
 use option::{Option, Some, None};
+use str;
 use unstable::intrinsics;
-use mem;
-
-pub use self::generated::*;
 
 uint_module!(uint, int, ::int::bits)
 
index 31f1b75e02e82f2151f07636c209e38bfa3d2246..ee3cd6446089a32bd3d74f030b0bc3b775c2b97e 100644 (file)
@@ -8,23 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// FIXME(#4375):  This shouldn't have to be a nested module named 'generated'...
-// FIXME(#10716): ... but now that we could solve that, the import lines and
-//                attributes still prevent a removal of that module.
-
 #[macro_escape];
 #[doc(hidden)];
 
-macro_rules! uint_module (($T:ty, $T_SIGNED:ty, $bits:expr) => (mod generated {
-
-#[allow(non_uppercase_statics)];
-
-use default::Default;
-use num::BitCount;
-use num::{ToStrRadix, FromStrRadix};
-use num::{CheckedDiv, Zero, One, strconv};
-use prelude::*;
-use str;
+macro_rules! uint_module (($T:ty, $T_SIGNED:ty, $bits:expr) => (
 
 pub static bits : uint = $bits;
 pub static bytes : uint = ($bits / 8);
@@ -554,4 +541,4 @@ fn test_unsigned_checked_div() {
     }
 }
 
-}))
+))