From e1fceafcea2b458cc44592947ef06ddf0ad39e58 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 31 Dec 2019 12:06:42 +0100 Subject: [PATCH 1/2] with FS access, default HashMap should work on macOS --- tests/run-pass/hashmap.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/run-pass/hashmap.rs b/tests/run-pass/hashmap.rs index 1ff9c26ba1..a63036780c 100644 --- a/tests/run-pass/hashmap.rs +++ b/tests/run-pass/hashmap.rs @@ -1,3 +1,6 @@ +// macOS needs FS access for its HashMap: +// compile-flags: -Zmiri-disable-isolation + use std::collections::{self, HashMap}; use std::hash::{BuildHasherDefault, BuildHasher}; @@ -18,14 +21,8 @@ fn test_map(mut map: HashMap) { assert_eq!(map.values().fold(0, |x, y| x+y), num*(num-1)/2); // TODO: Test Entry API, Iterators, ... - } fn main() { - if cfg!(target_os = "macos") { // TODO: Implement libstd HashMap seeding for macOS (https://github.com/rust-lang/miri/issues/686). - // Until then, use a deterministic map. - test_map::>(HashMap::default()); - } else { - test_map(HashMap::new()); - } + test_map(HashMap::new()); } From 31fbb5a9b2553cd095144fd0a5af4c976a5a3ae5 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 31 Dec 2019 12:10:52 +0100 Subject: [PATCH 2/2] fix imports --- tests/run-pass/hashmap.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/run-pass/hashmap.rs b/tests/run-pass/hashmap.rs index a63036780c..85116796d3 100644 --- a/tests/run-pass/hashmap.rs +++ b/tests/run-pass/hashmap.rs @@ -1,8 +1,8 @@ // macOS needs FS access for its HashMap: // compile-flags: -Zmiri-disable-isolation -use std::collections::{self, HashMap}; -use std::hash::{BuildHasherDefault, BuildHasher}; +use std::collections::HashMap; +use std::hash::BuildHasher; fn test_map(mut map: HashMap) { map.insert(0, 0);