diff options
| author | Brian Anderson <banderson@mozilla.com> | 2013-10-16 18:34:01 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-10-17 17:31:35 -0700 |
| commit | 34d376f3cf234dc714fcfab7639affd3967dc16d (patch) | |
| tree | 780dbbd084e9a57689e2565a2e1b3541a350eb86 /src/libstd/num | |
| parent | 3fd0e3a77be624f41647bb930843de27bc1cc985 (diff) | |
| download | rust-34d376f3cf234dc714fcfab7639affd3967dc16d.tar.gz rust-34d376f3cf234dc714fcfab7639affd3967dc16d.zip | |
std: Move size/align functions to std::mem. #2240
Diffstat (limited to 'src/libstd/num')
| -rw-r--r-- | src/libstd/num/f32.rs | 6 | ||||
| -rw-r--r-- | src/libstd/num/f64.rs | 6 | ||||
| -rw-r--r-- | src/libstd/num/int_macros.rs | 6 | ||||
| -rw-r--r-- | src/libstd/num/uint.rs | 6 | ||||
| -rw-r--r-- | src/libstd/num/uint_macros.rs | 6 |
5 files changed, 15 insertions, 15 deletions
diff --git a/src/libstd/num/f32.rs b/src/libstd/num/f32.rs index 2b4a636e1ad..e99dcd6b2eb 100644 --- a/src/libstd/num/f32.rs +++ b/src/libstd/num/f32.rs @@ -928,7 +928,7 @@ mod tests { use num::*; use num; - use sys; + use mem; #[test] fn test_num() { @@ -1198,8 +1198,8 @@ mod tests { #[test] fn test_primitive() { let none: Option<f32> = None; - assert_eq!(Primitive::bits(none), sys::size_of::<f32>() * 8); - assert_eq!(Primitive::bytes(none), sys::size_of::<f32>()); + assert_eq!(Primitive::bits(none), mem::size_of::<f32>() * 8); + assert_eq!(Primitive::bytes(none), mem::size_of::<f32>()); } #[test] diff --git a/src/libstd/num/f64.rs b/src/libstd/num/f64.rs index d4442e5b34f..f367de376d4 100644 --- a/src/libstd/num/f64.rs +++ b/src/libstd/num/f64.rs @@ -976,7 +976,7 @@ mod tests { use num::*; use num; - use sys; + use mem; #[test] fn test_num() { @@ -1249,8 +1249,8 @@ mod tests { #[test] fn test_primitive() { let none: Option<f64> = None; - assert_eq!(Primitive::bits(none), sys::size_of::<f64>() * 8); - assert_eq!(Primitive::bytes(none), sys::size_of::<f64>()); + assert_eq!(Primitive::bits(none), mem::size_of::<f64>() * 8); + assert_eq!(Primitive::bytes(none), mem::size_of::<f64>()); } #[test] diff --git a/src/libstd/num/int_macros.rs b/src/libstd/num/int_macros.rs index 7fae567809b..694e5e7f6bf 100644 --- a/src/libstd/num/int_macros.rs +++ b/src/libstd/num/int_macros.rs @@ -456,7 +456,7 @@ mod tests { use int; use i32; use num; - use sys; + use mem; #[test] fn test_num() { @@ -653,8 +653,8 @@ mod tests { #[test] fn test_primitive() { let none: Option<$T> = None; - assert_eq!(Primitive::bits(none), sys::size_of::<$T>() * 8); - assert_eq!(Primitive::bytes(none), sys::size_of::<$T>()); + assert_eq!(Primitive::bits(none), mem::size_of::<$T>() * 8); + assert_eq!(Primitive::bytes(none), mem::size_of::<$T>()); } #[test] diff --git a/src/libstd/num/uint.rs b/src/libstd/num/uint.rs index 38a4df270fc..2ecbb79407e 100644 --- a/src/libstd/num/uint.rs +++ b/src/libstd/num/uint.rs @@ -14,7 +14,7 @@ use num; use num::{CheckedAdd, CheckedSub, CheckedMul}; use option::{Option, Some, None}; use unstable::intrinsics; -use sys; +use mem; pub use self::generated::*; @@ -97,7 +97,7 @@ impl num::Times for uint { /// Returns the smallest power of 2 greater than or equal to `n` #[inline] pub fn next_power_of_two(n: uint) -> uint { - let halfbits: uint = sys::size_of::<uint>() * 4u; + let halfbits: uint = mem::size_of::<uint>() * 4u; let mut tmp: uint = n - 1u; let mut shift: uint = 1u; while shift <= halfbits { tmp |= tmp >> shift; shift <<= 1u; } @@ -107,7 +107,7 @@ pub fn next_power_of_two(n: uint) -> uint { /// Returns the smallest power of 2 greater than or equal to `n` #[inline] pub fn next_power_of_two_opt(n: uint) -> Option<uint> { - let halfbits: uint = sys::size_of::<uint>() * 4u; + let halfbits: uint = mem::size_of::<uint>() * 4u; let mut tmp: uint = n - 1u; let mut shift: uint = 1u; while shift <= halfbits { tmp |= tmp >> shift; shift <<= 1u; } diff --git a/src/libstd/num/uint_macros.rs b/src/libstd/num/uint_macros.rs index f52feced67c..2974b402d4a 100644 --- a/src/libstd/num/uint_macros.rs +++ b/src/libstd/num/uint_macros.rs @@ -337,7 +337,7 @@ mod tests { use super::*; use num; - use sys; + use mem; use u16; #[test] @@ -431,8 +431,8 @@ mod tests { #[test] fn test_primitive() { let none: Option<$T> = None; - assert_eq!(Primitive::bits(none), sys::size_of::<$T>() * 8); - assert_eq!(Primitive::bytes(none), sys::size_of::<$T>()); + assert_eq!(Primitive::bits(none), mem::size_of::<$T>() * 8); + assert_eq!(Primitive::bytes(none), mem::size_of::<$T>()); } #[test] |
