Add SAFETY comment for atomic example

This commit is contained in:
Phoebe Bell 2020-01-16 19:26:02 -08:00
parent 0f2ee495e9
commit 022a7de26f

View File

@ -1989,7 +1989,9 @@ extern {
}
let mut atomic = ", stringify!($atomic_type), "::new(1);
unsafe {
",
// SAFETY: Safe as long as `my_atomic_op` is atomic.
"unsafe {
my_atomic_op(atomic.as_mut_ptr());
}
# }