Skip to content

Commit 7af5f64

Browse files
committedMay 14, 2014
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 <[email protected]>
·
1.87.00.11.0
1 parent 6ce7dfb commit 7af5f64

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/libcollections/hashmap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,7 +1906,7 @@ mod test_map {
19061906
}
19071907
assert_eq!(m.len(), 32);
19081908

1909-
let mut observed = 0;
1909+
let mut observed: u32 = 0;
19101910

19111911
for (k, v) in m.iter() {
19121912
assert_eq!(*v, *k * 2);
@@ -2102,7 +2102,7 @@ mod test_set {
21022102
for i in range(0u, 32) {
21032103
assert!(a.insert(i));
21042104
}
2105-
let mut observed = 0;
2105+
let mut observed: u32 = 0;
21062106
for k in a.iter() {
21072107
observed |= 1 << *k;
21082108
}

5 commit comments

Comments
 (5)

bors commented on May 14, 2014

@bors
Collaborator

bors commented on May 14, 2014

@bors
Collaborator

merging omasanori/rust/suppress-warnings = 7af5f64 into auto

bors commented on May 14, 2014

@bors
Collaborator

omasanori/rust/suppress-warnings = 7af5f64 merged ok, testing candidate = d990681

bors commented on May 14, 2014

@bors
Collaborator

fast-forwarding master to auto = d990681

Please sign in to comment.