Skip to content

Commit aef7fbf

Browse files
Update documentation of as_ptr to reflect that its usage must not lead to data races.
1 parent 7d7de5b commit aef7fbf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/core/src/sync/atomic.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3406,7 +3406,7 @@ macro_rules! atomic_int {
34063406
/// atomic types work with interior mutability. All modifications of an atomic change the value
34073407
/// through a shared reference, and can do so safely as long as they use atomic operations. Any
34083408
/// use of the returned raw pointer requires an `unsafe` block and still has to uphold the same
3409-
/// restriction: operations on it must be atomic.
3409+
/// restriction: operations on it must not lead to data races.
34103410
///
34113411
/// # Examples
34123412
///
@@ -3420,7 +3420,7 @@ macro_rules! atomic_int {
34203420
///
34213421
#[doc = concat!("let atomic = ", stringify!($atomic_type), "::new(1);")]
34223422
///
3423-
/// // SAFETY: Safe as long as `my_atomic_op` is atomic.
3423+
/// // SAFETY: Safe as long as `my_atomic_op` does not lead to a data race.
34243424
/// unsafe {
34253425
/// my_atomic_op(atomic.as_ptr());
34263426
/// }

0 commit comments

Comments
 (0)