Skip to content

Commit

Permalink
Suppress warnings on 32bit platforms.
Browse files Browse the repository at this point in the history
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 <masanori.ogino@gmail.com>
  • Loading branch information
omasanori committed May 14, 2014
1 parent 6ce7dfb commit 7af5f64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libcollections/hashmap.rs
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down

5 comments on commit 7af5f64

@bors
Copy link
Contributor

@bors bors commented on 7af5f64 May 14, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 7af5f64 May 14, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@bors
Copy link
Contributor

@bors bors commented on 7af5f64 May 14, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@bors
Copy link
Contributor

@bors bors commented on 7af5f64 May 14, 2014

@bors
Copy link
Contributor

@bors bors commented on 7af5f64 May 14, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = d990681

Please sign in to comment.