We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d7c89cf commit 26af88aCopy full SHA for 26af88a
src/tools/miri/tests/pass/shims/env/var.rs
@@ -1,4 +1,5 @@
1
use std::env;
2
+use std::thread;
3
4
fn main() {
5
// Test that miri environment is isolated when communication is disabled.
@@ -23,4 +24,11 @@ fn main() {
23
24
env::remove_var("MIRI_TEST");
25
assert_eq!(env::var("MIRI_TEST"), Err(env::VarError::NotPresent));
26
println!("{:#?}", env::vars().collect::<Vec<_>>());
27
+
28
+ // Do things concurrently, to make sure there's no data race.
29
+ let t = thread::spawn(|| {
30
+ env::set_var("MIRI_TEST", "42");
31
+ });
32
33
+ t.join().unwrap();
34
}
0 commit comments