Skip to content

Commit 4e74f9f

Browse files
committed
Change to disable mir-opt in compile-flags
1 parent 3df6714 commit 4e74f9f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tests/compile-fail/data_race/read_write_race_stack.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ignore-windows: Concurrency on Windows is not supported yet.
2-
// compile-flags: -Zmiri-disable-isolation
2+
// compile-flags: -Zmiri-disable-isolation -Zmir-opt-level=0
33

44
use std::thread::{spawn, sleep};
55
use std::ptr::null_mut;
@@ -40,9 +40,7 @@ pub fn main() {
4040

4141
sleep(Duration::from_millis(1000));
4242

43-
// Read, the add 1 fixes -Z mir-opt-level=3 from removing the read via dest-prop and breaking
44-
// the test.
45-
stack_var + 1 //~ ERROR Data race detected between Read on Thread(id = 1) and Write on Thread(id = 2)
43+
stack_var //~ ERROR Data race detected between Read on Thread(id = 1) and Write on Thread(id = 2)
4644
});
4745

4846
let j2 = spawn(move || {

0 commit comments

Comments
 (0)