about summary refs log tree commit diff
path: root/src/libcoretest/num
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-04-03 04:29:52 +0000
committerbors <bors@rust-lang.org>2015-04-03 04:29:52 +0000
commitfc98b19cf72ea45851ebb7b28af160be92b19128 (patch)
tree8a19d8c1f6e9a71eb5e0286954519b4b7ec3fbf8 /src/libcoretest/num
parent5e30f05a05326018357c6fffdfb872e8a8d2367c (diff)
parent883adc6763c3dd06b282368698b28a07cdd65fd6 (diff)
downloadrust-fc98b19cf72ea45851ebb7b28af160be92b19128.tar.gz
rust-fc98b19cf72ea45851ebb7b28af160be92b19128.zip
Auto merge of #23832 - petrochenkov:usize, r=aturon
These constants are small and can fit even in `u8`, but semantically they have type `usize` because they denote sizes and are almost always used in `usize` context. The change of their type to `u32` during the integer audit led only to the large amount of `as usize` noise (see the second commit, which removes this noise).

This is a minor [breaking-change] to an unstable interface.

r? @aturon 

Diffstat (limited to 'src/libcoretest/num')
-rw-r--r--src/libcoretest/num/int_macros.rs6
-rw-r--r--src/libcoretest/num/uint_macros.rs6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/libcoretest/num/int_macros.rs b/src/libcoretest/num/int_macros.rs
index fa41167cae8..cb2359873e9 100644
--- a/src/libcoretest/num/int_macros.rs
+++ b/src/libcoretest/num/int_macros.rs
@@ -86,9 +86,9 @@ mod tests {
 
     #[test]
     fn test_count_zeros() {
-        assert!(A.count_zeros() == BITS - 3);
-        assert!(B.count_zeros() == BITS - 2);
-        assert!(C.count_zeros() == BITS - 5);
+        assert!(A.count_zeros() == BITS as u32 - 3);
+        assert!(B.count_zeros() == BITS as u32 - 2);
+        assert!(C.count_zeros() == BITS as u32 - 5);
     }
 
     #[test]
diff --git a/src/libcoretest/num/uint_macros.rs b/src/libcoretest/num/uint_macros.rs
index e3eff6e7512..5e00692766d 100644
--- a/src/libcoretest/num/uint_macros.rs
+++ b/src/libcoretest/num/uint_macros.rs
@@ -54,9 +54,9 @@ mod tests {
 
     #[test]
     fn test_count_zeros() {
-        assert!(A.count_zeros() == BITS - 3);
-        assert!(B.count_zeros() == BITS - 2);
-        assert!(C.count_zeros() == BITS - 5);
+        assert!(A.count_zeros() == BITS as u32 - 3);
+        assert!(B.count_zeros() == BITS as u32 - 2);
+        assert!(C.count_zeros() == BITS as u32 - 5);
     }
 
     #[test]