diff options
Diffstat (limited to 'src/tools/miri/tests/pass/0weak_memory_consistency.rs')
-rw-r--r-- | src/tools/miri/tests/pass/0weak_memory_consistency.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tools/miri/tests/pass/0weak_memory_consistency.rs b/src/tools/miri/tests/pass/0weak_memory_consistency.rs index f3820bd660d..abfe3b0adeb 100644 --- a/src/tools/miri/tests/pass/0weak_memory_consistency.rs +++ b/src/tools/miri/tests/pass/0weak_memory_consistency.rs @@ -10,7 +10,7 @@ // the RNG and never observed in our tests. // // To mitigate this, each test is ran enough times such that the chance -// of spurious success is very low. These tests never supriously fail. +// of spurious success is very low. These tests never spuriously fail. // Test cases and their consistent outcomes are from // http://svr-pes20-cppmem.cl.cam.ac.uk/cppmem/ @@ -116,11 +116,13 @@ fn test_message_passing() { #[rustfmt::skip] let j1 = spawn(move || { + let x = x; // avoid field capturing unsafe { *x.0 = 1 }; // -----------------------------------------+ y.store(1, Release); // ---------------------+ | }); // | | #[rustfmt::skip] // |synchronizes-with | happens-before let j2 = spawn(move || { // | | + let x = x; // avoid field capturing | | acquires_value(&y, 1); // <------------------+ | unsafe { *x.0 } // <---------------------------------------------+ }); |