Skip to content

Commit 022a7de

Browse files
committed
Add SAFETY comment for atomic example
1 parent 0f2ee49 commit 022a7de

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/libcore/sync/atomic.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1989,7 +1989,9 @@ extern {
19891989
}
19901990
19911991
let mut atomic = ", stringify!($atomic_type), "::new(1);
1992-
unsafe {
1992+
",
1993+
// SAFETY: Safe as long as `my_atomic_op` is atomic.
1994+
"unsafe {
19931995
my_atomic_op(atomic.as_mut_ptr());
19941996
}
19951997
# }

0 commit comments

Comments
 (0)