We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ca6252c commit 02917afCopy full SHA for 02917af
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