]> git.lizzy.rs Git - rust.git/commitdiff
with FS access, default HashMap should work on macOS
authorRalf Jung <post@ralfj.de>
Tue, 31 Dec 2019 11:06:42 +0000 (12:06 +0100)
committerRalf Jung <post@ralfj.de>
Tue, 31 Dec 2019 11:06:42 +0000 (12:06 +0100)
tests/run-pass/hashmap.rs

index 1ff9c26ba18c789e0359e4e7483fdd0495ee0d73..a63036780c998f94c79dd6d67a12526b1313e27f 100644 (file)
@@ -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<S: BuildHasher>(mut map: HashMap<i32, i32, S>) {
     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::<BuildHasherDefault<collections::hash_map::DefaultHasher>>(HashMap::default());
-    } else {
-        test_map(HashMap::new());
-    }
+    test_map(HashMap::new());
 }