From 7af5f646f1884dcfbcf0d2fae117db5502cfb38e Mon Sep 17 00:00:00 2001 From: OGINO Masanori Date: Wed, 14 May 2014 00:44:04 +0900 Subject: [PATCH] Suppress warnings on 32bit platforms. On 32bit platforms, int is the same as i32, so 0xffffffff is "out of range." Annotating variables as u32 fixes the problems. Signed-off-by: OGINO Masanori --- src/libcollections/hashmap.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcollections/hashmap.rs b/src/libcollections/hashmap.rs index 7dfc89b01de..3cffea46fec 100644 --- a/src/libcollections/hashmap.rs +++ b/src/libcollections/hashmap.rs @@ -1906,7 +1906,7 @@ mod test_map { } assert_eq!(m.len(), 32); - let mut observed = 0; + let mut observed: u32 = 0; for (k, v) in m.iter() { assert_eq!(*v, *k * 2); @@ -2102,7 +2102,7 @@ mod test_set { for i in range(0u, 32) { assert!(a.insert(i)); } - let mut observed = 0; + let mut observed: u32 = 0; for k in a.iter() { observed |= 1 << *k; }