Skip to content

Commit 86d7db4

Browse files
committed
Auto merge of #1134 - RalfJung:macos-hashmap, r=RalfJung
test macOS hashmap With #1130 landed, this should work now. Thanks @christianpoveda! Fixes #686
2 parents 39146c4 + 31fbb5a commit 86d7db4

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

tests/run-pass/hashmap.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
use std::collections::{self, HashMap};
2-
use std::hash::{BuildHasherDefault, BuildHasher};
1+
// macOS needs FS access for its HashMap:
2+
// compile-flags: -Zmiri-disable-isolation
3+
4+
use std::collections::HashMap;
5+
use std::hash::BuildHasher;
36

47
fn test_map<S: BuildHasher>(mut map: HashMap<i32, i32, S>) {
58
map.insert(0, 0);
@@ -18,14 +21,8 @@ fn test_map<S: BuildHasher>(mut map: HashMap<i32, i32, S>) {
1821
assert_eq!(map.values().fold(0, |x, y| x+y), num*(num-1)/2);
1922

2023
// TODO: Test Entry API, Iterators, ...
21-
2224
}
2325

2426
fn main() {
25-
if cfg!(target_os = "macos") { // TODO: Implement libstd HashMap seeding for macOS (https://github.com/rust-lang/miri/issues/686).
26-
// Until then, use a deterministic map.
27-
test_map::<BuildHasherDefault<collections::hash_map::DefaultHasher>>(HashMap::default());
28-
} else {
29-
test_map(HashMap::new());
30-
}
27+
test_map(HashMap::new());
3128
}

0 commit comments

Comments
 (0)