Skip to content

Commit

Permalink
add work-around for rust-lang#2164
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung authored and LegNeato committed Jul 14, 2022
1 parent 8770fb6 commit c5d0e17
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/pass/0weak_memory_consistency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ unsafe impl<T> Sync for EvilSend<T> {}
// multiple times
fn static_atomic(val: i32) -> &'static AtomicI32 {
let ret = Box::leak(Box::new(AtomicI32::new(val)));
ret.store(val, Relaxed); // work around https://github.com/rust-lang/miri/issues/2164
ret
}
fn static_atomic_bool(val: bool) -> &'static AtomicBool {
let ret = Box::leak(Box::new(AtomicBool::new(val)));
ret.store(val, Relaxed); // work around https://github.com/rust-lang/miri/issues/2164
ret
}

Expand Down

0 comments on commit c5d0e17

Please sign in to comment.