diff --git a/test-cargo-miri/src/main.rs b/test-cargo-miri/src/main.rs index 9ec8e85887a7..c21547c29ff9 100644 --- a/test-cargo-miri/src/main.rs +++ b/test-cargo-miri/src/main.rs @@ -19,7 +19,9 @@ mod test { fn rng() { let mut rng = rand::rngs::StdRng::seed_from_u64(0xcafebeef); let x: u32 = rng.gen(); - let y: u32 = rng.gen(); - assert_ne!(x, y); + let y: usize = rng.gen(); + let z: u128 = rng.gen(); + assert_ne!(x as usize, y); + assert_ne!(y as u128, z); } } diff --git a/test-cargo-miri/tests/test.rs b/test-cargo-miri/tests/test.rs index ed9efa21e4fa..31425d5ad973 100644 --- a/test-cargo-miri/tests/test.rs +++ b/test-cargo-miri/tests/test.rs @@ -7,17 +7,19 @@ fn simple() { assert_eq!(4, 4); } -// Having more than 1 test does seem to make a difference -// (i.e., this calls ptr::swap which having just one test does not). #[test] fn entropy_rng() { // Use this opportunity to test querying the RNG (needs an external crate, hence tested here and not in the compiletest suite) let mut rng = SmallRng::from_entropy(); let _val = rng.gen::(); + let _val = rng.gen::(); + let _val = rng.gen::(); // Also try per-thread RNG. let mut rng = rand::thread_rng(); let _val = rng.gen::(); + let _val = rng.gen::(); + let _val = rng.gen::(); } // A test that won't work on miri