about summary refs log tree commit diff
path: root/library/core/src
diff options
context:
space:
mode:
authorBoxy <rust@boxyuwu.dev>2024-09-05 17:23:40 +0100
committerBoxy <rust@boxyuwu.dev>2024-09-05 17:24:01 +0100
commit0091b8ab2a16aea880e2fe5d3c876f4f743640d5 (patch)
treeca11d992224c243236c438da5db5d151479dbe16 /library/core/src
parenta9998704d378dcb7bf399a5835dab1d22543c01f (diff)
downloadrust-0091b8ab2a16aea880e2fe5d3c876f4f743640d5.tar.gz
rust-0091b8ab2a16aea880e2fe5d3c876f4f743640d5.zip
update cfgs
Diffstat (limited to 'library/core/src')
-rw-r--r--library/core/src/arch.rs9
-rw-r--r--library/core/src/cell.rs6
-rw-r--r--library/core/src/clone.rs2
-rw-r--r--library/core/src/default.rs2
-rw-r--r--library/core/src/intrinsics.rs7
-rw-r--r--library/core/src/lib.rs4
-rw-r--r--library/core/src/marker.rs17
-rw-r--r--library/core/src/mem/manually_drop.rs2
-rw-r--r--library/core/src/mem/maybe_uninit.rs2
-rw-r--r--library/core/src/mem/mod.rs1
-rw-r--r--library/core/src/mem/transmutability.rs29
-rw-r--r--library/core/src/pin.rs2
-rw-r--r--library/core/src/tuple.rs2
13 files changed, 23 insertions, 62 deletions
diff --git a/library/core/src/arch.rs b/library/core/src/arch.rs
index d681bd124fe..31d6bc36fc8 100644
--- a/library/core/src/arch.rs
+++ b/library/core/src/arch.rs
@@ -4,15 +4,6 @@
 #[stable(feature = "simd_arch", since = "1.27.0")]
 pub use crate::core_arch::arch::*;
 
-#[cfg(bootstrap)]
-#[allow(dead_code)]
-#[unstable(feature = "sha512_sm_x86", issue = "126624")]
-fn dummy() {
-    // AArch64 also has a target feature named `sm4`, so we need `#![feature(sha512_sm_x86)]` in lib.rs
-    // But as the bootstrap compiler doesn't know about this feature yet, we need to convert it to a
-    // library feature until bootstrap gets bumped
-}
-
 /// Inline assembly.
 ///
 /// Refer to [Rust By Example] for a usage guide and the [reference] for
diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs
index 5dd9721d3fe..a3a471a57c7 100644
--- a/library/core/src/cell.rs
+++ b/library/core/src/cell.rs
@@ -306,7 +306,7 @@ pub use once::OnceCell;
 /// See the [module-level documentation](self) for more.
 #[stable(feature = "rust1", since = "1.0.0")]
 #[repr(transparent)]
-#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
+#[rustc_pub_transparent]
 pub struct Cell<T: ?Sized> {
     value: UnsafeCell<T>,
 }
@@ -2056,7 +2056,7 @@ impl<T: ?Sized + fmt::Display> fmt::Display for RefMut<'_, T> {
 #[lang = "unsafe_cell"]
 #[stable(feature = "rust1", since = "1.0.0")]
 #[repr(transparent)]
-#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
+#[rustc_pub_transparent]
 pub struct UnsafeCell<T: ?Sized> {
     value: T,
 }
@@ -2299,7 +2299,7 @@ impl<T> UnsafeCell<*mut T> {
 /// See [`UnsafeCell`] for details.
 #[unstable(feature = "sync_unsafe_cell", issue = "95439")]
 #[repr(transparent)]
-#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
+#[rustc_pub_transparent]
 pub struct SyncUnsafeCell<T: ?Sized> {
     value: UnsafeCell<T>,
 }
diff --git a/library/core/src/clone.rs b/library/core/src/clone.rs
index 21504630672..c5f8bd7401e 100644
--- a/library/core/src/clone.rs
+++ b/library/core/src/clone.rs
@@ -161,7 +161,7 @@ pub trait Clone: Sized {
     #[must_use = "cloning is often expensive and is not expected to have side effects"]
     // Clone::clone is special because the compiler generates MIR to implement it for some types.
     // See InstanceKind::CloneShim.
-    #[cfg_attr(not(bootstrap), lang = "clone_fn")]
+    #[lang = "clone_fn"]
     fn clone(&self) -> Self;
 
     /// Performs copy-assignment from `source`.
diff --git a/library/core/src/default.rs b/library/core/src/default.rs
index 5cacedcb241..4c30290ff26 100644
--- a/library/core/src/default.rs
+++ b/library/core/src/default.rs
@@ -103,7 +103,7 @@ use crate::ascii::Char as AsciiChar;
 /// ```
 #[cfg_attr(not(test), rustc_diagnostic_item = "Default")]
 #[stable(feature = "rust1", since = "1.0.0")]
-#[cfg_attr(not(bootstrap), rustc_trivial_field_reads)]
+#[rustc_trivial_field_reads]
 pub trait Default: Sized {
     /// Returns the "default value" for a type.
     ///
diff --git a/library/core/src/intrinsics.rs b/library/core/src/intrinsics.rs
index 8cb9accd59d..7870a62ea81 100644
--- a/library/core/src/intrinsics.rs
+++ b/library/core/src/intrinsics.rs
@@ -1020,7 +1020,6 @@ pub const fn unlikely(b: bool) -> bool {
 /// any safety invariants.
 ///
 /// This intrinsic does not have a stable counterpart.
-#[cfg(not(bootstrap))]
 #[unstable(feature = "core_intrinsics", issue = "none")]
 #[rustc_intrinsic]
 #[rustc_nounwind]
@@ -1030,12 +1029,6 @@ pub fn select_unpredictable<T>(b: bool, true_val: T, false_val: T) -> T {
     if b { true_val } else { false_val }
 }
 
-#[cfg(bootstrap)]
-#[inline]
-pub fn select_unpredictable<T>(b: bool, true_val: T, false_val: T) -> T {
-    if b { true_val } else { false_val }
-}
-
 extern "rust-intrinsic" {
     /// Executes a breakpoint trap, for inspection by a debugger.
     ///
diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs
index e60bcf3aa5d..50e9884fea1 100644
--- a/library/core/src/lib.rs
+++ b/library/core/src/lib.rs
@@ -107,7 +107,6 @@
 //
 // Library features:
 // tidy-alphabetical-start
-#![cfg_attr(bootstrap, feature(offset_of_nested))]
 #![feature(array_ptr_get)]
 #![feature(asm_experimental_arch)]
 #![feature(const_align_of_val)]
@@ -192,9 +191,6 @@
 //
 // Language features:
 // tidy-alphabetical-start
-#![cfg_attr(bootstrap, feature(asm_const))]
-#![cfg_attr(bootstrap, feature(const_fn_floating_point_arithmetic))]
-#![cfg_attr(bootstrap, feature(min_exhaustive_patterns))]
 #![feature(abi_unadjusted)]
 #![feature(adt_const_params)]
 #![feature(allow_internal_unsafe)]
diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs
index 5654f5aa4b8..84bb0119453 100644
--- a/library/core/src/marker.rs
+++ b/library/core/src/marker.rs
@@ -992,7 +992,7 @@ pub macro ConstParamTy($item:item) {
     /* compiler built-in */
 }
 
-#[cfg_attr(not(bootstrap), lang = "unsized_const_param_ty")]
+#[lang = "unsized_const_param_ty"]
 #[unstable(feature = "unsized_const_params", issue = "95174")]
 #[diagnostic::on_unimplemented(message = "`{Self}` can't be used as a const parameter type")]
 /// A marker for types which can be used as types of `const` generic parameters.
@@ -1002,10 +1002,9 @@ pub macro ConstParamTy($item:item) {
 pub trait UnsizedConstParamTy: StructuralPartialEq + Eq {}
 
 /// Derive macro generating an impl of the trait `ConstParamTy`.
-#[cfg(not(bootstrap))]
-#[cfg_attr(not(bootstrap), rustc_builtin_macro)]
-#[cfg_attr(not(bootstrap), allow_internal_unstable(unsized_const_params))]
-#[cfg_attr(not(bootstrap), unstable(feature = "unsized_const_params", issue = "95174"))]
+#[rustc_builtin_macro]
+#[allow_internal_unstable(unsized_const_params)]
+#[unstable(feature = "unsized_const_params", issue = "95174")]
 pub macro UnsizedConstParamTy($item:item) {
     /* compiler built-in */
 }
@@ -1021,14 +1020,6 @@ marker_impls! {
         (),
         {T: ConstParamTy_, const N: usize} [T; N],
 }
-#[cfg(bootstrap)]
-marker_impls! {
-    #[unstable(feature = "adt_const_params", issue = "95174")]
-    ConstParamTy_ for
-        str,
-        {T: ConstParamTy_} [T],
-        {T: ConstParamTy_ + ?Sized} &T,
-}
 
 marker_impls! {
     #[unstable(feature = "unsized_const_params", issue = "95174")]
diff --git a/library/core/src/mem/manually_drop.rs b/library/core/src/mem/manually_drop.rs
index be5cee2e852..3e47785ee48 100644
--- a/library/core/src/mem/manually_drop.rs
+++ b/library/core/src/mem/manually_drop.rs
@@ -47,7 +47,7 @@ use crate::ptr;
 #[lang = "manually_drop"]
 #[derive(Copy, Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
 #[repr(transparent)]
-#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
+#[rustc_pub_transparent]
 pub struct ManuallyDrop<T: ?Sized> {
     value: T,
 }
diff --git a/library/core/src/mem/maybe_uninit.rs b/library/core/src/mem/maybe_uninit.rs
index c308def2f57..4be2e5ef1ea 100644
--- a/library/core/src/mem/maybe_uninit.rs
+++ b/library/core/src/mem/maybe_uninit.rs
@@ -237,7 +237,7 @@ use crate::{fmt, intrinsics, ptr, slice};
 #[lang = "maybe_uninit"]
 #[derive(Copy)]
 #[repr(transparent)]
-#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
+#[rustc_pub_transparent]
 pub union MaybeUninit<T> {
     uninit: (),
     value: ManuallyDrop<T>,
diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs
index fed484ae3cd..414262fcf5a 100644
--- a/library/core/src/mem/mod.rs
+++ b/library/core/src/mem/mod.rs
@@ -1326,7 +1326,6 @@ impl<T> SizedTypeProperties for T {}
 /// # Examples
 ///
 /// ```
-/// # #![cfg_attr(bootstrap, feature(offset_of_nested))]
 /// #![feature(offset_of_enum)]
 ///
 /// use std::mem;
diff --git a/library/core/src/mem/transmutability.rs b/library/core/src/mem/transmutability.rs
index cda999a7f0c..7fa3c334391 100644
--- a/library/core/src/mem/transmutability.rs
+++ b/library/core/src/mem/transmutability.rs
@@ -43,8 +43,7 @@ use crate::marker::{ConstParamTy_, UnsizedConstParamTy};
 /// conversions that extend the bits of `Src` with trailing padding to fill
 /// trailing uninitialized bytes of `Self`; e.g.:
 ///
-#[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
-#[cfg_attr(not(bootstrap), doc = "```rust")]
+/// ```rust
 /// #![feature(transmutability)]
 ///
 /// use core::mem::{Assume, TransmuteFrom};
@@ -151,8 +150,7 @@ pub struct Assume {
     /// When `false`, [`TransmuteFrom`] is not implemented for transmutations
     /// that might violate the alignment requirements of references; e.g.:
     ///
-    #[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
-    #[cfg_attr(not(bootstrap), doc = "```compile_fail,E0277")]
+    /// ```compile_fail,E0277
     /// #![feature(transmutability)]
     /// use core::mem::{align_of, TransmuteFrom};
     ///
@@ -171,8 +169,7 @@ pub struct Assume {
     /// that references in the transmuted value satisfy the alignment
     /// requirements of their referent types; e.g.:
     ///
-    #[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
-    #[cfg_attr(not(bootstrap), doc = "```rust")]
+    /// ```rust
     /// #![feature(pointer_is_aligned_to, transmutability)]
     /// use core::mem::{align_of, Assume, TransmuteFrom};
     ///
@@ -203,8 +200,7 @@ pub struct Assume {
     /// that might violate the library safety invariants of the destination
     /// type; e.g.:
     ///
-    #[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
-    #[cfg_attr(not(bootstrap), doc = "```compile_fail,E0277")]
+    /// ```compile_fail,E0277
     /// #![feature(transmutability)]
     /// use core::mem::TransmuteFrom;
     ///
@@ -225,8 +221,7 @@ pub struct Assume {
     /// that undefined behavior does not arise from using the transmuted value;
     /// e.g.:
     ///
-    #[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
-    #[cfg_attr(not(bootstrap), doc = "```rust")]
+    /// ```rust
     /// #![feature(transmutability)]
     /// use core::mem::{Assume, TransmuteFrom};
     ///
@@ -254,8 +249,7 @@ pub struct Assume {
     /// that might violate the language-level bit-validity invariant of the
     /// destination type; e.g.:
     ///
-    #[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
-    #[cfg_attr(not(bootstrap), doc = "```compile_fail,E0277")]
+    /// ```compile_fail,E0277
     /// #![feature(transmutability)]
     /// use core::mem::TransmuteFrom;
     ///
@@ -271,8 +265,7 @@ pub struct Assume {
     /// that the value being transmuted is a bit-valid instance of the
     /// transmuted value; e.g.:
     ///
-    #[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
-    #[cfg_attr(not(bootstrap), doc = "```rust")]
+    /// ```rust
     /// #![feature(transmutability)]
     /// use core::mem::{Assume, TransmuteFrom};
     ///
@@ -335,9 +328,7 @@ impl Assume {
     /// This is especially useful for extending [`Assume`] in generic contexts;
     /// e.g.:
     ///
-    #[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
-    #[cfg_attr(not(bootstrap), doc = "```rust")]
-    #[unstable(feature = "transmutability", issue = "99571")]
+    /// ```rust
     /// #![feature(
     ///     adt_const_params,
     ///     generic_const_exprs,
@@ -379,6 +370,7 @@ impl Assume {
     ///     try_transmute_ref::<_, _, { Assume::NOTHING }>(src)
     /// };
     ///```
+    #[unstable(feature = "transmutability", issue = "99571")]
     pub const fn and(self, other_assumptions: Self) -> Self {
         Self {
             alignment: self.alignment || other_assumptions.alignment,
@@ -390,8 +382,7 @@ impl Assume {
 
     /// Remove `other_assumptions` the obligations of `self`; e.g.:
     ///
-    #[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
-    #[cfg_attr(not(bootstrap), doc = "```rust")]
+    /// ```rust
     /// #![feature(transmutability)]
     /// use core::mem::Assume;
     ///
diff --git a/library/core/src/pin.rs b/library/core/src/pin.rs
index 65f6bfb7ee1..9c13662e08e 100644
--- a/library/core/src/pin.rs
+++ b/library/core/src/pin.rs
@@ -1084,7 +1084,7 @@ use crate::{cmp, fmt};
 #[lang = "pin"]
 #[fundamental]
 #[repr(transparent)]
-#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
+#[rustc_pub_transparent]
 #[derive(Copy, Clone)]
 pub struct Pin<Ptr> {
     // FIXME(#93176): this field is made `#[unstable] #[doc(hidden)] pub` to:
diff --git a/library/core/src/tuple.rs b/library/core/src/tuple.rs
index 9ec92e28450..206b5b9e2c2 100644
--- a/library/core/src/tuple.rs
+++ b/library/core/src/tuple.rs
@@ -154,7 +154,7 @@ macro_rules! tuple_impls {
 // Otherwise, it hides the docs entirely.
 macro_rules! maybe_tuple_doc {
     ($a:ident @ #[$meta:meta] $item:item) => {
-        #[cfg_attr(not(bootstrap), doc(fake_variadic))]
+        #[doc(fake_variadic)]
         #[doc = "This trait is implemented for tuples up to twelve items long."]
         #[$meta]
         $item