Skip to content

Commit 820f322

Browse files
committed
add work-around for rust-lang#2164
1 parent a272ca2 commit 820f322

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/pass/0weak_memory_consistency.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ unsafe impl<T> Sync for EvilSend<T> {}
3434
// multiple times
3535
fn static_atomic(val: i32) -> &'static AtomicI32 {
3636
let ret = Box::leak(Box::new(AtomicI32::new(val)));
37+
ret.store(val, Relaxed); // work around https://github.com/rust-lang/miri/issues/2164
3738
ret
3839
}
3940
fn static_atomic_bool(val: bool) -> &'static AtomicBool {
4041
let ret = Box::leak(Box::new(AtomicBool::new(val)));
42+
ret.store(val, Relaxed); // work around https://github.com/rust-lang/miri/issues/2164
4143
ret
4244
}
4345

0 commit comments

Comments
 (0)