add work-around for #2164

This commit is contained in:
Ralf Jung 2022-07-14 08:07:59 -04:00
parent a272ca2cf7
commit 820f322b86

View File

@ -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
}