Sign in
rust
/
miri
/
refs/heads/try
/
.
/
tests
/
pass
/
static_memory_modification.rs
blob: 84a524b1ed1635c6c2e8eb21c8b8dfccdc65dbf0 [
file
] [
log
] [
blame
] [
edit
]
use
std
::
sync
::
atomic
::{
AtomicUsize
,
Ordering
};
static
mut
X
:
usize
=
5
;
static
Y
:
AtomicUsize
=
AtomicUsize
::
new
(
5
);
fn
main
()
{
unsafe
{
X
=
6
;
assert_eq
!(
X
,
6
);
}
Y
.
store
(
6
,
Ordering
::
Relaxed
);
assert_eq
!(
Y
.
load
(
Ordering
::
Relaxed
),
6
);
}