Skip to content

Commit

Permalink
Add SAFETY comment for atomic example
Browse files Browse the repository at this point in the history
  • Loading branch information
foeb committed Jan 17, 2020
1 parent 0f2ee49 commit 022a7de
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/libcore/sync/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
# }
Expand Down

0 comments on commit 022a7de

Please sign in to comment.