mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-02 00:07:42 +03:00
core docs: add notes about availability of Atomic*::from_mut_slice
This commit is contained in:
@@ -1558,6 +1558,8 @@ pub fn get_mut(&mut self) -> &mut *mut T {
|
||||
|
||||
/// Gets atomic access to a pointer.
|
||||
///
|
||||
/// **Note:** This function is only available on targets where `AtomicPtr<T>` has the same alignment as `*const T`
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
@@ -1625,6 +1627,8 @@ pub fn get_mut_slice(this: &mut [Self]) -> &mut [*mut T] {
|
||||
|
||||
/// Gets atomic access to a slice of pointers.
|
||||
///
|
||||
/// **Note:** This function is only available on targets where `AtomicPtr<T>` has the same alignment as `*const T`
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```ignore-wasm
|
||||
@@ -2804,6 +2808,14 @@ pub fn get_mut_slice(this: &mut [Self]) -> &mut [$int_type] {
|
||||
|
||||
#[doc = concat!("Get atomic access to a `&mut [", stringify!($int_type), "]` slice.")]
|
||||
///
|
||||
#[doc = if_8_bit! {
|
||||
$int_type,
|
||||
no = [
|
||||
"**Note:** This function is only available on targets where `",
|
||||
stringify!($atomic_type), "` has the same alignment as `", stringify!($int_type), "`."
|
||||
],
|
||||
}]
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```ignore-wasm
|
||||
|
||||
Reference in New Issue
Block a user