Skip to content

Commit 1d93179

Browse files
authored
Unrolled build for #148578
Rollup merge of #148578 - WaffleLapkin:equal-alignment-atomic-from-mut-slice, r=m-ou-se core docs: add notes about availability of `Atomic*::from_mut_slice` See #76314 (comment) r? libs-api
2 parents c90bcb9 + 893f0d2 commit 1d93179

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

library/core/src/sync/atomic.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,6 +1558,8 @@ impl<T> AtomicPtr<T> {
15581558

15591559
/// Gets atomic access to a pointer.
15601560
///
1561+
/// **Note:** This function is only available on targets where `AtomicPtr<T>` has the same alignment as `*const T`
1562+
///
15611563
/// # Examples
15621564
///
15631565
/// ```
@@ -1625,6 +1627,8 @@ impl<T> AtomicPtr<T> {
16251627

16261628
/// Gets atomic access to a slice of pointers.
16271629
///
1630+
/// **Note:** This function is only available on targets where `AtomicPtr<T>` has the same alignment as `*const T`
1631+
///
16281632
/// # Examples
16291633
///
16301634
/// ```ignore-wasm
@@ -2804,6 +2808,14 @@ macro_rules! atomic_int {
28042808

28052809
#[doc = concat!("Get atomic access to a `&mut [", stringify!($int_type), "]` slice.")]
28062810
///
2811+
#[doc = if_8_bit! {
2812+
$int_type,
2813+
no = [
2814+
"**Note:** This function is only available on targets where `",
2815+
stringify!($atomic_type), "` has the same alignment as `", stringify!($int_type), "`."
2816+
],
2817+
}]
2818+
///
28072819
/// # Examples
28082820
///
28092821
/// ```ignore-wasm

0 commit comments

Comments
 (0)