apply bootstrap cfgs

This commit is contained in:
Pietro Albini
2020-08-26 10:17:31 +02:00
parent e88d79ca41
commit 3e16d4af7f
14 changed files with 25 additions and 26 deletions

View File

@@ -362,7 +362,6 @@ macro_rules! array_impl_default {
array_impl_default! {32, T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T} array_impl_default! {32, T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T}
#[cfg(not(bootstrap))]
#[lang = "array"] #[lang = "array"]
impl<T, const N: usize> [T; N] { impl<T, const N: usize> [T; N] {
/// Returns an array of the same size as `self`, with function `f` applied to each element /// Returns an array of the same size as `self`, with function `f` applied to each element

View File

@@ -385,7 +385,7 @@ pub trait Into<T>: Sized {
))] ))]
pub trait From<T>: Sized { pub trait From<T>: Sized {
/// Performs the conversion. /// Performs the conversion.
#[cfg_attr(not(bootstrap), lang = "from")] #[lang = "from"]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
fn from(_: T) -> Self; fn from(_: T) -> Self;
} }

View File

@@ -96,7 +96,7 @@ pub trait Future {
/// [`Context`]: ../task/struct.Context.html /// [`Context`]: ../task/struct.Context.html
/// [`Waker`]: ../task/struct.Waker.html /// [`Waker`]: ../task/struct.Waker.html
/// [`Waker::wake`]: ../task/struct.Waker.html#method.wake /// [`Waker::wake`]: ../task/struct.Waker.html#method.wake
#[cfg_attr(not(bootstrap), lang = "poll")] #[lang = "poll"]
#[stable(feature = "futures_api", since = "1.36.0")] #[stable(feature = "futures_api", since = "1.36.0")]
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>; fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>;
} }

View File

@@ -53,7 +53,7 @@ unsafe impl Sync for ResumeTy {}
/// This function returns a `GenFuture` underneath, but hides it in `impl Trait` to give /// This function returns a `GenFuture` underneath, but hides it in `impl Trait` to give
/// better error messages (`impl Future` rather than `GenFuture<[closure.....]>`). /// better error messages (`impl Future` rather than `GenFuture<[closure.....]>`).
// This is `const` to avoid extra errors after we recover from `const async fn` // This is `const` to avoid extra errors after we recover from `const async fn`
#[cfg_attr(not(bootstrap), lang = "from_generator")] #[lang = "from_generator"]
#[doc(hidden)] #[doc(hidden)]
#[unstable(feature = "gen_future", issue = "50547")] #[unstable(feature = "gen_future", issue = "50547")]
#[inline] #[inline]
@@ -86,7 +86,7 @@ where
GenFuture(gen) GenFuture(gen)
} }
#[cfg_attr(not(bootstrap), lang = "get_context")] #[lang = "get_context"]
#[doc(hidden)] #[doc(hidden)]
#[unstable(feature = "gen_future", issue = "50547")] #[unstable(feature = "gen_future", issue = "50547")]
#[inline] #[inline]

View File

@@ -235,7 +235,7 @@ pub trait IntoIterator {
/// assert_eq!(Some(3), iter.next()); /// assert_eq!(Some(3), iter.next());
/// assert_eq!(None, iter.next()); /// assert_eq!(None, iter.next());
/// ``` /// ```
#[cfg_attr(not(bootstrap), lang = "into_iter")] #[lang = "into_iter"]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
fn into_iter(self) -> Self::IntoIter; fn into_iter(self) -> Self::IntoIter;
} }

View File

@@ -130,7 +130,7 @@ pub trait Iterator {
/// assert_eq!(None, iter.next()); /// assert_eq!(None, iter.next());
/// assert_eq!(None, iter.next()); /// assert_eq!(None, iter.next());
/// ``` /// ```
#[cfg_attr(not(bootstrap), lang = "next")] #[lang = "next"]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
fn next(&mut self) -> Option<Self::Item>; fn next(&mut self) -> Option<Self::Item>;

View File

@@ -98,7 +98,7 @@
#![feature(custom_inner_attributes)] #![feature(custom_inner_attributes)]
#![feature(decl_macro)] #![feature(decl_macro)]
#![feature(doc_cfg)] #![feature(doc_cfg)]
#![cfg_attr(not(bootstrap), feature(doc_spotlight))] #![feature(doc_spotlight)]
#![feature(duration_consts_2)] #![feature(duration_consts_2)]
#![feature(extern_types)] #![feature(extern_types)]
#![feature(fundamental)] #![feature(fundamental)]

View File

@@ -708,7 +708,7 @@ mod impls {
pub trait DiscriminantKind { pub trait DiscriminantKind {
/// The type of the discriminant, which must satisfy the trait /// The type of the discriminant, which must satisfy the trait
/// bounds required by `mem::Discriminant`. /// bounds required by `mem::Discriminant`.
#[cfg_attr(not(bootstrap), lang = "discriminant_type")] #[lang = "discriminant_type"]
type Discriminant: Clone + Copy + Debug + Eq + PartialEq + Hash + Send + Sync + Unpin; type Discriminant: Clone + Copy + Debug + Eq + PartialEq + Hash + Send + Sync + Unpin;
} }

View File

@@ -36,7 +36,7 @@ use crate::hash::Hash;
/// ``` /// ```
/// ///
/// [slicing index]: crate::slice::SliceIndex /// [slicing index]: crate::slice::SliceIndex
#[cfg_attr(not(bootstrap), lang = "RangeFull")] #[lang = "RangeFull"]
#[doc(alias = "..")] #[doc(alias = "..")]
#[derive(Copy, Clone, Default, PartialEq, Eq, Hash)] #[derive(Copy, Clone, Default, PartialEq, Eq, Hash)]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
@@ -69,7 +69,7 @@ impl fmt::Debug for RangeFull {
/// assert_eq!(arr[1.. 3], [ 1,2 ]); // Range /// assert_eq!(arr[1.. 3], [ 1,2 ]); // Range
/// assert_eq!(arr[1..=3], [ 1,2,3 ]); /// assert_eq!(arr[1..=3], [ 1,2,3 ]);
/// ``` /// ```
#[cfg_attr(not(bootstrap), lang = "Range")] #[lang = "Range"]
#[doc(alias = "..")] #[doc(alias = "..")]
#[derive(Clone, Default, PartialEq, Eq, Hash)] // not Copy -- see #27186 #[derive(Clone, Default, PartialEq, Eq, Hash)] // not Copy -- see #27186
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
@@ -172,7 +172,7 @@ impl<Idx: PartialOrd<Idx>> Range<Idx> {
/// assert_eq!(arr[1.. 3], [ 1,2 ]); /// assert_eq!(arr[1.. 3], [ 1,2 ]);
/// assert_eq!(arr[1..=3], [ 1,2,3 ]); /// assert_eq!(arr[1..=3], [ 1,2,3 ]);
/// ``` /// ```
#[cfg_attr(not(bootstrap), lang = "RangeFrom")] #[lang = "RangeFrom"]
#[doc(alias = "..")] #[doc(alias = "..")]
#[derive(Clone, PartialEq, Eq, Hash)] // not Copy -- see #27186 #[derive(Clone, PartialEq, Eq, Hash)] // not Copy -- see #27186
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
@@ -253,7 +253,7 @@ impl<Idx: PartialOrd<Idx>> RangeFrom<Idx> {
/// ``` /// ```
/// ///
/// [slicing index]: crate::slice::SliceIndex /// [slicing index]: crate::slice::SliceIndex
#[cfg_attr(not(bootstrap), lang = "RangeTo")] #[lang = "RangeTo"]
#[doc(alias = "..")] #[doc(alias = "..")]
#[derive(Copy, Clone, PartialEq, Eq, Hash)] #[derive(Copy, Clone, PartialEq, Eq, Hash)]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
@@ -322,7 +322,7 @@ impl<Idx: PartialOrd<Idx>> RangeTo<Idx> {
/// assert_eq!(arr[1.. 3], [ 1,2 ]); /// assert_eq!(arr[1.. 3], [ 1,2 ]);
/// assert_eq!(arr[1..=3], [ 1,2,3 ]); // RangeInclusive /// assert_eq!(arr[1..=3], [ 1,2,3 ]); // RangeInclusive
/// ``` /// ```
#[cfg_attr(not(bootstrap), lang = "RangeInclusive")] #[lang = "RangeInclusive"]
#[doc(alias = "..=")] #[doc(alias = "..=")]
#[derive(Clone, PartialEq, Eq, Hash)] // not Copy -- see #27186 #[derive(Clone, PartialEq, Eq, Hash)] // not Copy -- see #27186
#[stable(feature = "inclusive_range", since = "1.26.0")] #[stable(feature = "inclusive_range", since = "1.26.0")]
@@ -354,7 +354,7 @@ impl<Idx> RangeInclusive<Idx> {
/// ///
/// assert_eq!(3..=5, RangeInclusive::new(3, 5)); /// assert_eq!(3..=5, RangeInclusive::new(3, 5));
/// ``` /// ```
#[cfg_attr(not(bootstrap), lang = "range_inclusive_new")] #[lang = "range_inclusive_new"]
#[stable(feature = "inclusive_range_methods", since = "1.27.0")] #[stable(feature = "inclusive_range_methods", since = "1.27.0")]
#[inline] #[inline]
#[rustc_promotable] #[rustc_promotable]
@@ -543,7 +543,7 @@ impl<Idx: PartialOrd<Idx>> RangeInclusive<Idx> {
/// ``` /// ```
/// ///
/// [slicing index]: crate::slice::SliceIndex /// [slicing index]: crate::slice::SliceIndex
#[cfg_attr(not(bootstrap), lang = "RangeToInclusive")] #[lang = "RangeToInclusive"]
#[doc(alias = "..=")] #[doc(alias = "..=")]
#[derive(Copy, Clone, PartialEq, Eq, Hash)] #[derive(Copy, Clone, PartialEq, Eq, Hash)]
#[stable(feature = "inclusive_range", since = "1.26.0")] #[stable(feature = "inclusive_range", since = "1.26.0")]

View File

@@ -43,19 +43,19 @@ pub trait Try {
/// in the return type of the enclosing scope (which must itself implement /// in the return type of the enclosing scope (which must itself implement
/// `Try`). Specifically, the value `X::from_error(From::from(e))` /// `Try`). Specifically, the value `X::from_error(From::from(e))`
/// is returned, where `X` is the return type of the enclosing function. /// is returned, where `X` is the return type of the enclosing function.
#[cfg_attr(not(bootstrap), lang = "into_result")] #[lang = "into_result"]
#[unstable(feature = "try_trait", issue = "42327")] #[unstable(feature = "try_trait", issue = "42327")]
fn into_result(self) -> Result<Self::Ok, Self::Error>; fn into_result(self) -> Result<Self::Ok, Self::Error>;
/// Wrap an error value to construct the composite result. For example, /// Wrap an error value to construct the composite result. For example,
/// `Result::Err(x)` and `Result::from_error(x)` are equivalent. /// `Result::Err(x)` and `Result::from_error(x)` are equivalent.
#[cfg_attr(not(bootstrap), lang = "from_error")] #[lang = "from_error"]
#[unstable(feature = "try_trait", issue = "42327")] #[unstable(feature = "try_trait", issue = "42327")]
fn from_error(v: Self::Error) -> Self; fn from_error(v: Self::Error) -> Self;
/// Wrap an OK value to construct the composite result. For example, /// Wrap an OK value to construct the composite result. For example,
/// `Result::Ok(x)` and `Result::from_ok(x)` are equivalent. /// `Result::Ok(x)` and `Result::from_ok(x)` are equivalent.
#[cfg_attr(not(bootstrap), lang = "from_ok")] #[lang = "from_ok"]
#[unstable(feature = "try_trait", issue = "42327")] #[unstable(feature = "try_trait", issue = "42327")]
fn from_ok(v: Self::Ok) -> Self; fn from_ok(v: Self::Ok) -> Self;
} }

View File

@@ -144,11 +144,11 @@ use crate::{
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub enum Option<T> { pub enum Option<T> {
/// No value /// No value
#[cfg_attr(not(bootstrap), lang = "None")] #[lang = "None"]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
None, None,
/// Some value `T` /// Some value `T`
#[cfg_attr(not(bootstrap), lang = "Some")] #[lang = "Some"]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
Some(#[stable(feature = "rust1", since = "1.0.0")] T), Some(#[stable(feature = "rust1", since = "1.0.0")] T),
} }

View File

@@ -555,7 +555,7 @@ impl<P: Deref> Pin<P> {
/// ``` /// ```
/// ///
/// [`mem::swap`]: crate::mem::swap /// [`mem::swap`]: crate::mem::swap
#[cfg_attr(not(bootstrap), lang = "new_unchecked")] #[lang = "new_unchecked"]
#[stable(feature = "pin", since = "1.33.0")] #[stable(feature = "pin", since = "1.33.0")]
#[inline(always)] #[inline(always)]
pub unsafe fn new_unchecked(pointer: P) -> Pin<P> { pub unsafe fn new_unchecked(pointer: P) -> Pin<P> {

View File

@@ -240,12 +240,12 @@ use crate::{convert, fmt};
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub enum Result<T, E> { pub enum Result<T, E> {
/// Contains the success value /// Contains the success value
#[cfg_attr(not(bootstrap), lang = "Ok")] #[lang = "Ok"]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
Ok(#[stable(feature = "rust1", since = "1.0.0")] T), Ok(#[stable(feature = "rust1", since = "1.0.0")] T),
/// Contains the error value /// Contains the error value
#[cfg_attr(not(bootstrap), lang = "Err")] #[lang = "Err"]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
Err(#[stable(feature = "rust1", since = "1.0.0")] E), Err(#[stable(feature = "rust1", since = "1.0.0")] E),
} }

View File

@@ -10,7 +10,7 @@ use crate::result::Result;
#[stable(feature = "futures_api", since = "1.36.0")] #[stable(feature = "futures_api", since = "1.36.0")]
pub enum Poll<T> { pub enum Poll<T> {
/// Represents that a value is immediately ready. /// Represents that a value is immediately ready.
#[cfg_attr(not(bootstrap), lang = "Ready")] #[lang = "Ready"]
#[stable(feature = "futures_api", since = "1.36.0")] #[stable(feature = "futures_api", since = "1.36.0")]
Ready(#[stable(feature = "futures_api", since = "1.36.0")] T), Ready(#[stable(feature = "futures_api", since = "1.36.0")] T),
@@ -19,7 +19,7 @@ pub enum Poll<T> {
/// When a function returns `Pending`, the function *must* also /// When a function returns `Pending`, the function *must* also
/// ensure that the current task is scheduled to be awoken when /// ensure that the current task is scheduled to be awoken when
/// progress can be made. /// progress can be made.
#[cfg_attr(not(bootstrap), lang = "Pending")] #[lang = "Pending"]
#[stable(feature = "futures_api", since = "1.36.0")] #[stable(feature = "futures_api", since = "1.36.0")]
Pending, Pending,
} }