about summary refs log tree commit diff
path: root/src/libcore/sync
diff options
context:
space:
mode:
authorPhoebe Bell <minaphoebebell@gmail.com>2020-01-16 19:26:02 -0800
committerPhoebe Bell <minaphoebebell@gmail.com>2020-01-16 19:26:02 -0800
commit022a7de26f5cb386ec853eec3b7f44dcd516a6d1 (patch)
tree63a8f381104a16e909b30601d7f4e4f9bb03c5f8 /src/libcore/sync
parent0f2ee495e9a9d677466ce0c1827ba20919a5ca1f (diff)
downloadrust-022a7de26f5cb386ec853eec3b7f44dcd516a6d1.tar.gz
rust-022a7de26f5cb386ec853eec3b7f44dcd516a6d1.zip
Add SAFETY comment for atomic example
Diffstat (limited to 'src/libcore/sync')
-rw-r--r--src/libcore/sync/atomic.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs
index 8d55dc55ef2..9d449bb9915 100644
--- a/src/libcore/sync/atomic.rs
+++ b/src/libcore/sync/atomic.rs
@@ -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());
 }
 # }