Skip to content

Commit e0467f8

Browse files
committed
Fixup Atomic*::from_ptr safety docs
1 parent ab73de7 commit e0467f8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

library/core/src/sync/atomic.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,8 @@ impl AtomicBool {
357357
/// duration of lifetime `'a`. Most use cases should be able to follow this guideline.
358358
/// * This requirement is also trivially satisfied if all accesses (atomic or not) are done
359359
/// from the same thread.
360+
/// * This method must not be used to perform overlapping or mixed-size atomic
361+
/// accesses, as these are not supported by the memory model.
360362
///
361363
/// [valid]: crate::ptr#safety
362364
#[stable(feature = "atomic_from_ptr", since = "CURRENT_RUSTC_VERSION")]
@@ -1159,7 +1161,7 @@ impl<T> AtomicPtr<T> {
11591161
/// duration of lifetime `'a`. Most use cases should be able to follow this guideline.
11601162
/// * This requirement is also trivially satisfied if all accesses (atomic or not) are done
11611163
/// from the same thread.
1162-
/// * This method should not be used to create overlapping or mixed-size atomic accesses, as
1164+
/// * This method must not be used to perform overlapping or mixed-size atomic accesses, as
11631165
/// these are not supported by the memory model.
11641166
///
11651167
/// [valid]: crate::ptr#safety
@@ -2142,7 +2144,7 @@ macro_rules! atomic_int {
21422144
/// this guideline.
21432145
/// * This requirement is also trivially satisfied if all accesses (atomic or not) are
21442146
/// done from the same thread.
2145-
/// * This method should not be used to create overlapping or mixed-size atomic
2147+
/// * This method must not be used to perform overlapping or mixed-size atomic
21462148
/// accesses, as these are not supported by the memory model.
21472149
///
21482150
/// [valid]: crate::ptr#safety

0 commit comments

Comments
 (0)