@@ -357,8 +357,11 @@ impl AtomicBool {
357
357
/// duration of lifetime `'a`. Most use cases should be able to follow this guideline.
358
358
/// * This requirement is also trivially satisfied if all accesses (atomic or not) are done
359
359
/// 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.
360
+ /// * Atomic accesses that overlap must either all use the same address and size,
361
+ /// or they must have a happens-before relationship.
362
+ /// * In other words, within one of the atomic time periods mentioned in the previous
363
+ /// bullet, there cannot be accesses to the same value that overlap only partially.
364
+ /// They must either not overlap at all or overlap perfectly.
362
365
///
363
366
/// [valid]: crate::ptr#safety
364
367
#[ stable( feature = "atomic_from_ptr" , since = "CURRENT_RUSTC_VERSION" ) ]
@@ -1161,8 +1164,11 @@ impl<T> AtomicPtr<T> {
1161
1164
/// duration of lifetime `'a`. Most use cases should be able to follow this guideline.
1162
1165
/// * This requirement is also trivially satisfied if all accesses (atomic or not) are done
1163
1166
/// from the same thread.
1164
- /// * This method must not be used to perform overlapping or mixed-size atomic accesses, as
1165
- /// these are not supported by the memory model.
1167
+ /// * Atomic accesses that overlap must either all use the same address and size,
1168
+ /// or they must have a happens-before relationship.
1169
+ /// * In other words, within one of the atomic time periods mentioned in the previous
1170
+ /// bullet, there cannot be accesses to the same value that overlap only partially.
1171
+ /// They must either not overlap at all or overlap perfectly.
1166
1172
///
1167
1173
/// [valid]: crate::ptr#safety
1168
1174
#[ stable( feature = "atomic_from_ptr" , since = "CURRENT_RUSTC_VERSION" ) ]
@@ -2144,8 +2150,11 @@ macro_rules! atomic_int {
2144
2150
/// this guideline.
2145
2151
/// * This requirement is also trivially satisfied if all accesses (atomic or not) are
2146
2152
/// done from the same thread.
2147
- /// * This method must not be used to perform overlapping or mixed-size atomic
2148
- /// accesses, as these are not supported by the memory model.
2153
+ /// * Atomic accesses that overlap must either all use the same address and size,
2154
+ /// or they must have a happens-before relationship.
2155
+ /// * In other words, within one of the atomic time periods mentioned in the previous
2156
+ /// bullet, there cannot be accesses to the same value that overlap only partially.
2157
+ /// They must either not overlap at all or overlap perfectly.
2149
2158
///
2150
2159
/// [valid]: crate::ptr#safety
2151
2160
#[ stable( feature = "atomic_from_ptr" , since = "CURRENT_RUSTC_VERSION" ) ]
0 commit comments