Add cfg_attr(bootstrap) to doc tests

This commit is contained in:
Gary Guo 2024-04-20 20:35:04 +01:00
parent 9d16364198
commit f8a1cad07c

View File

@ -512,6 +512,7 @@ pub fn from_mut(v: &mut bool) -> &mut Self {
/// ///
/// ``` /// ```
/// #![feature(atomic_from_mut)] /// #![feature(atomic_from_mut)]
/// # #![cfg_attr(bootstrap, feature(inline_const))]
/// use std::sync::atomic::{AtomicBool, Ordering}; /// use std::sync::atomic::{AtomicBool, Ordering};
/// ///
/// let mut some_bools = [const { AtomicBool::new(false) }; 10]; /// let mut some_bools = [const { AtomicBool::new(false) }; 10];
@ -1314,6 +1315,7 @@ pub fn from_mut(v: &mut *mut T) -> &mut Self {
/// ///
/// ``` /// ```
/// #![feature(atomic_from_mut)] /// #![feature(atomic_from_mut)]
/// # #![cfg_attr(bootstrap, feature(inline_const))]
/// use std::ptr::null_mut; /// use std::ptr::null_mut;
/// use std::sync::atomic::{AtomicPtr, Ordering}; /// use std::sync::atomic::{AtomicPtr, Ordering};
/// ///
@ -2304,6 +2306,7 @@ pub fn from_mut(v: &mut $int_type) -> &mut Self {
/// ///
/// ``` /// ```
/// #![feature(atomic_from_mut)] /// #![feature(atomic_from_mut)]
/// # #![cfg_attr(bootstrap, feature(inline_const))]
#[doc = concat!($extra_feature, "use std::sync::atomic::{", stringify!($atomic_type), ", Ordering};")] #[doc = concat!($extra_feature, "use std::sync::atomic::{", stringify!($atomic_type), ", Ordering};")]
/// ///
#[doc = concat!("let mut some_ints = [const { ", stringify!($atomic_type), "::new(0) }; 10];")] #[doc = concat!("let mut some_ints = [const { ", stringify!($atomic_type), "::new(0) }; 10];")]