Sign in
rust
/
rust
/
08cd08fbef8c6663b052d8d9e4930d5696cbb8a7
/
.
/
library
/
std
/
tests
/
volatile-fat-ptr.rs
blob: 406eb7c80afb553370222536de5e70e22cfb277e [
file
]
use
std
::
ptr
::{
read_volatile
,
write_volatile
};
#[
test
]
fn
volatile_fat_ptr
()
{
let
mut
x
:
&
'
static
str
=
"test"
;
unsafe
{
let
a
=
read_volatile
(&
x
);
assert_eq
!(
a
,
"test"
);
write_volatile
(&
mut
x
,
"foo"
);
assert_eq
!(
x
,
"foo"
);
}
}