From 9a668dea286784e85de805d3d9846424749f68f1 Mon Sep 17 00:00:00 2001 From: Martin Matusiak Date: Tue, 5 Jan 2016 22:32:51 +0100 Subject: [PATCH 1/2] add type annotations (fixes build on 1.7.0-nightly (d5e229057 2016-01-04)) --- src/isaac.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/isaac.rs b/src/isaac.rs index 1b271b52419..f4dd3c37643 100644 --- a/src/isaac.rs +++ b/src/isaac.rs @@ -131,7 +131,7 @@ impl IsaacRng { const MIDPOINT: usize = RAND_SIZE_USIZE / 2; macro_rules! ind { - ($x:expr) => ( self.mem[($x >> 2).0 as usize & (RAND_SIZE_USIZE - 1)] ) + ($x:expr) => ( self.mem[($x >> 2u64).0 as usize & (RAND_SIZE_USIZE - 1)] ) } let r = [(0, MIDPOINT), (MIDPOINT, 0)]; @@ -370,7 +370,7 @@ impl Isaac64Rng { const MP_VEC: [(usize, usize); 2] = [(0,MIDPOINT), (MIDPOINT, 0)]; macro_rules! ind { ($x:expr) => { - *self.mem.get_unchecked((($x >> 3).0 as usize) & (RAND_SIZE_64 - 1)) + *self.mem.get_unchecked((($x >> 3u64).0 as usize) & (RAND_SIZE_64 - 1)) } } From 35c48a8233dd8cd55f5ff790e0359c4b38788780 Mon Sep 17 00:00:00 2001 From: Martin Matusiak Date: Tue, 5 Jan 2016 22:48:30 +0100 Subject: [PATCH 2/2] the literals are usize no u64 --- src/isaac.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/isaac.rs b/src/isaac.rs index f4dd3c37643..42de3523fb0 100644 --- a/src/isaac.rs +++ b/src/isaac.rs @@ -131,7 +131,7 @@ impl IsaacRng { const MIDPOINT: usize = RAND_SIZE_USIZE / 2; macro_rules! ind { - ($x:expr) => ( self.mem[($x >> 2u64).0 as usize & (RAND_SIZE_USIZE - 1)] ) + ($x:expr) => ( self.mem[($x >> 2usize).0 as usize & (RAND_SIZE_USIZE - 1)] ) } let r = [(0, MIDPOINT), (MIDPOINT, 0)]; @@ -370,7 +370,7 @@ impl Isaac64Rng { const MP_VEC: [(usize, usize); 2] = [(0,MIDPOINT), (MIDPOINT, 0)]; macro_rules! ind { ($x:expr) => { - *self.mem.get_unchecked((($x >> 3u64).0 as usize) & (RAND_SIZE_64 - 1)) + *self.mem.get_unchecked((($x >> 3usize).0 as usize) & (RAND_SIZE_64 - 1)) } }