File tree 12 files changed +93
-57
lines changed
12 files changed +93
-57
lines changed Original file line number Diff line number Diff line change 10
10
11
11
//! Operations and constants for `i16`
12
12
13
+ #[ allow( non_uppercase_statics) ] ;
14
+
15
+ use prelude:: * ;
16
+
17
+ use default:: Default ;
13
18
use num:: { BitCount , CheckedAdd , CheckedSub , CheckedMul } ;
19
+ use num:: { CheckedDiv , Zero , One , strconv} ;
20
+ use num:: { ToStrRadix , FromStrRadix } ;
14
21
use option:: { Option , Some , None } ;
22
+ use str;
15
23
use unstable:: intrinsics;
16
24
17
- pub use self :: generated:: * ;
18
-
19
25
int_module ! ( i16 , 16 )
20
26
21
27
impl BitCount for i16 {
Original file line number Diff line number Diff line change 10
10
11
11
//! Operations and constants for `i32`
12
12
13
+ #[ allow( non_uppercase_statics) ] ;
14
+
15
+ use prelude:: * ;
16
+
17
+ use default:: Default ;
13
18
use num:: { BitCount , CheckedAdd , CheckedSub , CheckedMul } ;
19
+ use num:: { CheckedDiv , Zero , One , strconv} ;
20
+ use num:: { ToStrRadix , FromStrRadix } ;
14
21
use option:: { Option , Some , None } ;
22
+ use str;
15
23
use unstable:: intrinsics;
16
24
17
- pub use self :: generated:: * ;
18
-
19
25
int_module ! ( i32 , 32 )
20
26
21
27
impl BitCount for i32 {
Original file line number Diff line number Diff line change 10
10
11
11
//! Operations and constants for `i64`
12
12
13
- use num:: { BitCount , CheckedAdd , CheckedSub } ;
13
+ #[ allow( non_uppercase_statics) ] ;
14
+
15
+ use prelude:: * ;
16
+
17
+ use default:: Default ;
14
18
#[ cfg( target_word_size = "64" ) ]
15
19
use num:: CheckedMul ;
20
+ use num:: { BitCount , CheckedAdd , CheckedSub } ;
21
+ use num:: { CheckedDiv , Zero , One , strconv} ;
22
+ use num:: { ToStrRadix , FromStrRadix } ;
16
23
use option:: { Option , Some , None } ;
24
+ use str;
17
25
use unstable:: intrinsics;
18
26
19
- pub use self :: generated:: * ;
20
-
21
27
int_module ! ( i64 , 64 )
22
28
23
29
impl BitCount for i64 {
Original file line number Diff line number Diff line change 10
10
11
11
//! Operations and constants for `i8`
12
12
13
+ #[ allow( non_uppercase_statics) ] ;
14
+
15
+ use prelude:: * ;
16
+
17
+ use default:: Default ;
13
18
use num:: { BitCount , CheckedAdd , CheckedSub , CheckedMul } ;
19
+ use num:: { CheckedDiv , Zero , One , strconv} ;
20
+ use num:: { ToStrRadix , FromStrRadix } ;
14
21
use option:: { Option , Some , None } ;
22
+ use str;
15
23
use unstable:: intrinsics;
16
24
17
- pub use self :: generated:: * ;
18
-
19
25
int_module ! ( i8 , 8 )
20
26
21
27
impl BitCount for i8 {
Original file line number Diff line number Diff line change 12
12
13
13
#[ allow( non_uppercase_statics) ] ;
14
14
15
+ use prelude:: * ;
16
+
17
+ use default:: Default ;
15
18
use num:: { BitCount , CheckedAdd , CheckedSub , CheckedMul } ;
19
+ use num:: { CheckedDiv , Zero , One , strconv} ;
20
+ use num:: { ToStrRadix , FromStrRadix } ;
16
21
use option:: { Option , Some , None } ;
22
+ use str;
17
23
use unstable:: intrinsics;
18
24
19
- pub use self :: generated:: * ;
20
-
21
- #[ cfg( target_word_size = "32" ) ] pub static bits: uint = 32 ;
22
- #[ cfg( target_word_size = "64" ) ] pub static bits: uint = 64 ;
23
-
24
- int_module ! ( int, super :: bits)
25
+ #[ cfg( target_word_size = "32" ) ] int_module ! ( int, 32 )
26
+ #[ cfg( target_word_size = "64" ) ] int_module ! ( int, 64 )
25
27
26
28
#[ cfg( target_word_size = "32" ) ]
27
29
impl BitCount for int {
Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
- // FIXME(#4375): This shouldn't have to be a nested module named 'generated'...
12
- // FIXME(#10716): ... but now that we could solve that, the import lines and
13
- // attributes still prevent a removal of that module.
14
-
15
11
#[ macro_escape] ;
16
12
#[ doc( hidden) ] ;
17
13
18
- macro_rules! int_module ( ( $T: ty, $bits: expr) => ( mod generated {
19
-
20
- #[ allow( non_uppercase_statics) ] ;
21
-
22
- use default :: Default ;
23
- use num:: { ToStrRadix , FromStrRadix } ;
24
- use num:: { CheckedDiv , Zero , One , strconv} ;
25
- use prelude:: * ;
26
- use str ;
14
+ macro_rules! int_module ( ( $T: ty, $bits: expr) => (
27
15
28
16
pub static bits : uint = $bits;
29
17
pub static bytes : uint = ( $bits / 8 ) ;
@@ -781,4 +769,4 @@ mod tests {
781
769
}
782
770
}
783
771
784
- } ) )
772
+ ) )
Original file line number Diff line number Diff line change 10
10
11
11
//! Operations and constants for `u16`
12
12
13
+ #[ allow( non_uppercase_statics) ] ;
14
+
15
+ use prelude:: * ;
16
+
17
+ use default:: Default ;
18
+ use num:: BitCount ;
13
19
use num:: { CheckedAdd , CheckedSub , CheckedMul } ;
20
+ use num:: { CheckedDiv , Zero , One , strconv} ;
21
+ use num:: { ToStrRadix , FromStrRadix } ;
14
22
use option:: { Option , Some , None } ;
23
+ use str;
15
24
use unstable:: intrinsics;
16
25
17
- pub use self :: generated:: * ;
18
-
19
26
uint_module ! ( u16 , i16 , 16 )
20
27
21
28
impl CheckedAdd for u16 {
Original file line number Diff line number Diff line change 10
10
11
11
//! Operations and constants for `u32`
12
12
13
+ #[ allow( non_uppercase_statics) ] ;
14
+
15
+ use prelude:: * ;
16
+
17
+ use default:: Default ;
18
+ use num:: BitCount ;
13
19
use num:: { CheckedAdd , CheckedSub , CheckedMul } ;
20
+ use num:: { CheckedDiv , Zero , One , strconv} ;
21
+ use num:: { ToStrRadix , FromStrRadix } ;
14
22
use option:: { Option , Some , None } ;
23
+ use str;
15
24
use unstable:: intrinsics;
16
25
17
- pub use self :: generated:: * ;
18
-
19
26
uint_module ! ( u32 , i32 , 32 )
20
27
21
28
impl CheckedAdd for u32 {
Original file line number Diff line number Diff line change 10
10
11
11
//! Operations and constants for `u64`
12
12
13
- use num:: { CheckedAdd , CheckedSub } ;
13
+ #[ allow( non_uppercase_statics) ] ;
14
+
15
+ use prelude:: * ;
16
+
17
+ use default:: Default ;
18
+ use num:: BitCount ;
14
19
#[ cfg( target_word_size = "64" ) ]
15
20
use num:: CheckedMul ;
21
+ use num:: { CheckedAdd , CheckedSub } ;
22
+ use num:: { CheckedDiv , Zero , One , strconv} ;
23
+ use num:: { ToStrRadix , FromStrRadix } ;
16
24
use option:: { Option , Some , None } ;
25
+ use str;
17
26
use unstable:: intrinsics;
18
27
19
- pub use self :: generated:: * ;
20
-
21
28
uint_module ! ( u64 , i64 , 64 )
22
29
23
30
impl CheckedAdd for u64 {
Original file line number Diff line number Diff line change 10
10
11
11
//! Operations and constants for `u8`
12
12
13
+ #[ allow( non_uppercase_statics) ] ;
14
+
15
+ use prelude:: * ;
16
+
17
+ use default:: Default ;
18
+ use num:: BitCount ;
13
19
use num:: { CheckedAdd , CheckedSub , CheckedMul } ;
20
+ use num:: { CheckedDiv , Zero , One , strconv} ;
21
+ use num:: { ToStrRadix , FromStrRadix } ;
14
22
use option:: { Option , Some , None } ;
23
+ use str;
15
24
use unstable:: intrinsics;
16
25
17
- pub use self :: generated:: * ;
18
-
19
26
uint_module ! ( u8 , i8 , 8 )
20
27
21
28
impl CheckedAdd for u8 {
Original file line number Diff line number Diff line change 10
10
11
11
//! Operations and constants for `uint`
12
12
13
- use num;
13
+ #[ allow( non_uppercase_statics) ] ;
14
+
15
+ use prelude:: * ;
16
+
17
+ use default:: Default ;
18
+ use mem;
19
+ use num:: BitCount ;
14
20
use num:: { CheckedAdd , CheckedSub , CheckedMul } ;
21
+ use num:: { CheckedDiv , Zero , One , strconv} ;
22
+ use num:: { ToStrRadix , FromStrRadix } ;
23
+ use num;
15
24
use option:: { Option , Some , None } ;
25
+ use str;
16
26
use unstable:: intrinsics;
17
- use mem;
18
-
19
- pub use self :: generated:: * ;
20
27
21
28
uint_module ! ( uint, int, :: int:: bits)
22
29
Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
- // FIXME(#4375): This shouldn't have to be a nested module named 'generated'...
12
- // FIXME(#10716): ... but now that we could solve that, the import lines and
13
- // attributes still prevent a removal of that module.
14
-
15
11
#[ macro_escape] ;
16
12
#[ doc( hidden) ] ;
17
13
18
- macro_rules! uint_module ( ( $T: ty, $T_SIGNED: ty, $bits: expr) => ( mod generated {
19
-
20
- #[ allow( non_uppercase_statics) ] ;
21
-
22
- use default :: Default ;
23
- use num:: BitCount ;
24
- use num:: { ToStrRadix , FromStrRadix } ;
25
- use num:: { CheckedDiv , Zero , One , strconv} ;
26
- use prelude:: * ;
27
- use str ;
14
+ macro_rules! uint_module ( ( $T: ty, $T_SIGNED: ty, $bits: expr) => (
28
15
29
16
pub static bits : uint = $bits;
30
17
pub static bytes : uint = ( $bits / 8 ) ;
@@ -554,4 +541,4 @@ mod tests {
554
541
}
555
542
}
556
543
557
- } ) )
544
+ ) )
You can’t perform that action at this time.
0 commit comments