Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS now uses SecRandomCopyBytes for us #721

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7c71bc3208031b1307573de45a3b3e18fa45787a
758dc9af504e2fe75813bd362619231ecc727898
13 changes: 3 additions & 10 deletions tests/run-pass/hashmap.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// compile-flags: -Zmiri-seed=0000000000000000

use std::collections::{self, HashMap};
use std::hash::{BuildHasherDefault, BuildHasher};
use std::collections::HashMap;
use std::hash::BuildHasher;

fn test_map<S: BuildHasher>(mut map: HashMap<i32, i32, S>) {
map.insert(0, 0);
Expand All @@ -24,12 +24,5 @@ fn test_map<S: BuildHasher>(mut map: HashMap<i32, i32, S>) {
}

fn main() {
if cfg!(target_os = "macos") { // TODO: Implement random number generation on OS X.
// Until then, use a deterministic map.
let map : HashMap<i32, i32, BuildHasherDefault<collections::hash_map::DefaultHasher>> = HashMap::default();
test_map(map);
} else {
let map: HashMap<i32, i32> = HashMap::default();
test_map(map);
}
test_map(HashMap::new());
}