about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--library/alloc/src/boxed.rs3
-rw-r--r--library/alloc/src/lib.rs1
-rw-r--r--library/core/src/future/async_drop.rs1
-rw-r--r--library/core/src/future/future.rs2
-rw-r--r--library/core/src/intrinsics.rs11
-rw-r--r--library/core/src/intrinsics/simd.rs1
-rw-r--r--library/core/src/iter/traits/collect.rs3
-rw-r--r--library/core/src/num/int_macros.rs18
-rw-r--r--library/core/src/ops/async_function.rs8
-rw-r--r--library/core/src/ptr/metadata.rs40
-rw-r--r--library/std/src/env.rs16
-rw-r--r--src/bootstrap/src/core/build_steps/compile.rs5
-rw-r--r--src/bootstrap/src/core/build_steps/tool.rs5
13 files changed, 22 insertions, 92 deletions
diff --git a/library/alloc/src/boxed.rs b/library/alloc/src/boxed.rs
index 2b5141585de..01a954ed75b 100644
--- a/library/alloc/src/boxed.rs
+++ b/library/alloc/src/boxed.rs
@@ -145,8 +145,7 @@
 //! to `into_iter()` for boxed slices will defer to the slice implementation on editions before
 //! 2024:
 //!
-#![cfg_attr(bootstrap, doc = "```rust,edition2021,ignore")]
-#![cfg_attr(not(bootstrap), doc = "```rust,edition2021")]
+//! ```rust,edition2021
 //! // Rust 2015, 2018, and 2021:
 //!
 //! # #![allow(boxed_slice_into_iter)] // override our `deny(warnings)`
diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs
index 4749b8880fb..895d1b8d59f 100644
--- a/library/alloc/src/lib.rs
+++ b/library/alloc/src/lib.rs
@@ -165,7 +165,6 @@
 //
 // Language features:
 // tidy-alphabetical-start
-#![cfg_attr(bootstrap, feature(exclusive_range_pattern))]
 #![cfg_attr(not(test), feature(coroutine_trait))]
 #![cfg_attr(test, feature(panic_update_hook))]
 #![cfg_attr(test, feature(test))]
diff --git a/library/core/src/future/async_drop.rs b/library/core/src/future/async_drop.rs
index 25138c445c4..5c3a0a98b10 100644
--- a/library/core/src/future/async_drop.rs
+++ b/library/core/src/future/async_drop.rs
@@ -256,7 +256,6 @@ async unsafe fn either<O: IntoFuture<Output = ()>, M: IntoFuture<Output = ()>, T
     }
 }
 
-#[cfg(not(bootstrap))]
 #[lang = "async_drop_deferred_drop_in_place"]
 async unsafe fn deferred_drop_in_place<T>(to_drop: *mut T) {
     // SAFETY: same safety requirements as with drop_in_place (implied by
diff --git a/library/core/src/future/future.rs b/library/core/src/future/future.rs
index 86963b548b9..c80cfdcebf7 100644
--- a/library/core/src/future/future.rs
+++ b/library/core/src/future/future.rs
@@ -35,7 +35,7 @@ use crate::task::{Context, Poll};
 pub trait Future {
     /// The type of value produced on completion.
     #[stable(feature = "futures_api", since = "1.36.0")]
-    #[cfg_attr(not(bootstrap), lang = "future_output")]
+    #[lang = "future_output"]
     type Output;
 
     /// Attempt to resolve the future to a final value, registering
diff --git a/library/core/src/intrinsics.rs b/library/core/src/intrinsics.rs
index 28397fe4619..cd3534ecb12 100644
--- a/library/core/src/intrinsics.rs
+++ b/library/core/src/intrinsics.rs
@@ -986,7 +986,7 @@ pub const unsafe fn assume(b: bool) {
 #[unstable(feature = "core_intrinsics", issue = "none")]
 #[rustc_intrinsic]
 #[rustc_nounwind]
-#[cfg_attr(not(bootstrap), miri::intrinsic_fallback_is_spec)]
+#[miri::intrinsic_fallback_is_spec]
 pub const fn likely(b: bool) -> bool {
     b
 }
@@ -1006,7 +1006,7 @@ pub const fn likely(b: bool) -> bool {
 #[unstable(feature = "core_intrinsics", issue = "none")]
 #[rustc_intrinsic]
 #[rustc_nounwind]
-#[cfg_attr(not(bootstrap), miri::intrinsic_fallback_is_spec)]
+#[miri::intrinsic_fallback_is_spec]
 pub const fn unlikely(b: bool) -> bool {
     b
 }
@@ -2482,7 +2482,7 @@ extern "rust-intrinsic" {
 #[rustc_nounwind]
 #[rustc_do_not_const_check]
 #[inline]
-#[cfg_attr(not(bootstrap), miri::intrinsic_fallback_is_spec)]
+#[miri::intrinsic_fallback_is_spec]
 pub const fn ptr_guaranteed_cmp<T>(ptr: *const T, other: *const T) -> u8 {
     (ptr == other) as u8
 }
@@ -2747,7 +2747,7 @@ pub const fn ub_checks() -> bool {
 #[unstable(feature = "core_intrinsics", issue = "none")]
 #[rustc_nounwind]
 #[rustc_intrinsic]
-#[cfg_attr(not(bootstrap), miri::intrinsic_fallback_is_spec)]
+#[miri::intrinsic_fallback_is_spec]
 pub const unsafe fn const_allocate(_size: usize, _align: usize) -> *mut u8 {
     // const eval overrides this function, but runtime code for now just returns null pointers.
     // See <https://github.com/rust-lang/rust/issues/93935>.
@@ -2768,7 +2768,7 @@ pub const unsafe fn const_allocate(_size: usize, _align: usize) -> *mut u8 {
 #[unstable(feature = "core_intrinsics", issue = "none")]
 #[rustc_nounwind]
 #[rustc_intrinsic]
-#[cfg_attr(not(bootstrap), miri::intrinsic_fallback_is_spec)]
+#[miri::intrinsic_fallback_is_spec]
 pub const unsafe fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) {
     // Runtime NOP
 }
@@ -2828,7 +2828,6 @@ impl<P: ?Sized, T: ptr::Thin> AggregateRawPtr<*mut T> for *mut P {
 #[rustc_const_unstable(feature = "ptr_metadata", issue = "81513")]
 #[rustc_intrinsic]
 #[rustc_intrinsic_must_be_overridden]
-#[cfg(not(bootstrap))]
 pub const fn ptr_metadata<P: ptr::Pointee<Metadata = M> + ?Sized, M>(_ptr: *const P) -> M {
     // To implement a fallback we'd have to assume the layout of the pointer,
     // but the whole point of this intrinsic is that we shouldn't do that.
diff --git a/library/core/src/intrinsics/simd.rs b/library/core/src/intrinsics/simd.rs
index 820f6b2cddc..4be5e62ea5b 100644
--- a/library/core/src/intrinsics/simd.rs
+++ b/library/core/src/intrinsics/simd.rs
@@ -573,7 +573,6 @@ extern "rust-intrinsic" {
     ///
     /// `T` must be a vector of integers.
     #[rustc_nounwind]
-    #[cfg(not(bootstrap))]
     pub fn simd_ctpop<T>(x: T) -> T;
 
     /// Count the trailing zeros of each element.
diff --git a/library/core/src/iter/traits/collect.rs b/library/core/src/iter/traits/collect.rs
index d9d860c7b6c..61a45789013 100644
--- a/library/core/src/iter/traits/collect.rs
+++ b/library/core/src/iter/traits/collect.rs
@@ -311,8 +311,7 @@ where
     label = "`{Self}` is not an iterator",
     message = "`{Self}` is not an iterator"
 )]
-#[cfg_attr(bootstrap, rustc_skip_array_during_method_dispatch)]
-#[cfg_attr(not(bootstrap), rustc_skip_during_method_dispatch(array, boxed_slice))]
+#[rustc_skip_during_method_dispatch(array, boxed_slice)]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub trait IntoIterator {
     /// The type of the elements being iterated over.
diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs
index 96510ee4dca..55bb6166f10 100644
--- a/library/core/src/num/int_macros.rs
+++ b/library/core/src/num/int_macros.rs
@@ -1165,17 +1165,13 @@ macro_rules! int_impl {
         #[inline(always)]
         #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
         pub const unsafe fn unchecked_neg(self) -> Self {
-            // ICE resolved by #125184 isn't in bootstrap compiler
-            #[cfg(not(bootstrap))]
-            {
-                assert_unsafe_precondition!(
-                    check_language_ub,
-                    concat!(stringify!($SelfT), "::unchecked_neg cannot overflow"),
-                    (
-                        lhs: $SelfT = self,
-                    ) => !lhs.overflowing_neg().1,
-                );
-            }
+            assert_unsafe_precondition!(
+                check_language_ub,
+                concat!(stringify!($SelfT), "::unchecked_neg cannot overflow"),
+                (
+                    lhs: $SelfT = self,
+                ) => !lhs.overflowing_neg().1,
+            );
 
             // SAFETY: this is guaranteed to be safe by the caller.
             unsafe {
diff --git a/library/core/src/ops/async_function.rs b/library/core/src/ops/async_function.rs
index f4e9d1a63ac..48d1042d9df 100644
--- a/library/core/src/ops/async_function.rs
+++ b/library/core/src/ops/async_function.rs
@@ -26,7 +26,7 @@ pub trait AsyncFn<Args: Tuple>: AsyncFnMut<Args> {
 pub trait AsyncFnMut<Args: Tuple>: AsyncFnOnce<Args> {
     /// Future returned by [`AsyncFnMut::async_call_mut`] and [`AsyncFn::async_call`].
     #[unstable(feature = "async_fn_traits", issue = "none")]
-    #[cfg_attr(not(bootstrap), lang = "call_ref_future")]
+    #[lang = "call_ref_future"]
     type CallRefFuture<'a>: Future<Output = Self::Output>
     where
         Self: 'a;
@@ -47,12 +47,12 @@ pub trait AsyncFnMut<Args: Tuple>: AsyncFnOnce<Args> {
 pub trait AsyncFnOnce<Args: Tuple> {
     /// Future returned by [`AsyncFnOnce::async_call_once`].
     #[unstable(feature = "async_fn_traits", issue = "none")]
-    #[cfg_attr(not(bootstrap), lang = "call_once_future")]
+    #[lang = "call_once_future"]
     type CallOnceFuture: Future<Output = Self::Output>;
 
     /// Output type of the called closure's future.
     #[unstable(feature = "async_fn_traits", issue = "none")]
-    #[cfg_attr(not(bootstrap), lang = "async_fn_once_output")]
+    #[lang = "async_fn_once_output"]
     type Output;
 
     /// Call the [`AsyncFnOnce`], returning a future which may move out of the called closure.
@@ -146,7 +146,7 @@ mod internal_implementation_detail {
         // `for<'env> fn() -> (&'env T, ...)`. This allows us to represent the binder
         // of the closure's self-capture, and these upvar types will be instantiated with
         // the `'closure_env` region provided to the associated type.
-        #[cfg_attr(not(bootstrap), lang = "async_fn_kind_upvars")]
+        #[lang = "async_fn_kind_upvars"]
         type Upvars<'closure_env, Inputs, Upvars, BorrowedUpvarsAsFnPtr>;
     }
 }
diff --git a/library/core/src/ptr/metadata.rs b/library/core/src/ptr/metadata.rs
index 78fe0c5add5..eb86bf66206 100644
--- a/library/core/src/ptr/metadata.rs
+++ b/library/core/src/ptr/metadata.rs
@@ -3,7 +3,6 @@
 use crate::fmt;
 use crate::hash::{Hash, Hasher};
 use crate::intrinsics::aggregate_raw_ptr;
-#[cfg(not(bootstrap))]
 use crate::intrinsics::ptr_metadata;
 use crate::marker::Freeze;
 
@@ -96,17 +95,7 @@ pub trait Thin = Pointee<Metadata = ()>;
 #[rustc_const_unstable(feature = "ptr_metadata", issue = "81513")]
 #[inline]
 pub const fn metadata<T: ?Sized>(ptr: *const T) -> <T as Pointee>::Metadata {
-    #[cfg(bootstrap)]
-    {
-        // SAFETY: Accessing the value from the `PtrRepr` union is safe since *const T
-        // and PtrComponents<T> have the same memory layouts. Only std can make this
-        // guarantee.
-        unsafe { PtrRepr { const_ptr: ptr }.components.metadata }
-    }
-    #[cfg(not(bootstrap))]
-    {
-        ptr_metadata(ptr)
-    }
+    ptr_metadata(ptr)
 }
 
 /// Forms a (possibly-wide) raw pointer from a data pointer and metadata.
@@ -140,33 +129,6 @@ pub const fn from_raw_parts_mut<T: ?Sized>(
     aggregate_raw_ptr(data_pointer, metadata)
 }
 
-#[repr(C)]
-#[cfg(bootstrap)]
-union PtrRepr<T: ?Sized> {
-    const_ptr: *const T,
-    mut_ptr: *mut T,
-    components: PtrComponents<T>,
-}
-
-#[repr(C)]
-#[cfg(bootstrap)]
-struct PtrComponents<T: ?Sized> {
-    data_pointer: *const (),
-    metadata: <T as Pointee>::Metadata,
-}
-
-// Manual impl needed to avoid `T: Copy` bound.
-#[cfg(bootstrap)]
-impl<T: ?Sized> Copy for PtrComponents<T> {}
-
-// Manual impl needed to avoid `T: Clone` bound.
-#[cfg(bootstrap)]
-impl<T: ?Sized> Clone for PtrComponents<T> {
-    fn clone(&self) -> Self {
-        *self
-    }
-}
-
 /// The metadata for a `Dyn = dyn SomeTrait` trait object type.
 ///
 /// It is a pointer to a vtable (virtual call table)
diff --git a/library/std/src/env.rs b/library/std/src/env.rs
index 4d649f8a6f1..b7b817d97c9 100644
--- a/library/std/src/env.rs
+++ b/library/std/src/env.rs
@@ -361,20 +361,12 @@ impl Error for VarError {
 /// }
 /// assert_eq!(env::var(key), Ok("VALUE".to_string()));
 /// ```
-#[cfg(not(bootstrap))]
 #[rustc_deprecated_safe_2024]
 #[stable(feature = "env", since = "1.0.0")]
 pub unsafe fn set_var<K: AsRef<OsStr>, V: AsRef<OsStr>>(key: K, value: V) {
     _set_var(key.as_ref(), value.as_ref())
 }
 
-#[cfg(bootstrap)]
-#[allow(missing_docs)]
-#[stable(feature = "env", since = "1.0.0")]
-pub fn set_var<K: AsRef<OsStr>, V: AsRef<OsStr>>(key: K, value: V) {
-    unsafe { _set_var(key.as_ref(), value.as_ref()) }
-}
-
 unsafe fn _set_var(key: &OsStr, value: &OsStr) {
     os_imp::setenv(key, value).unwrap_or_else(|e| {
         panic!("failed to set environment variable `{key:?}` to `{value:?}`: {e}")
@@ -434,20 +426,12 @@ unsafe fn _set_var(key: &OsStr, value: &OsStr) {
 /// }
 /// assert!(env::var(key).is_err());
 /// ```
-#[cfg(not(bootstrap))]
 #[rustc_deprecated_safe_2024]
 #[stable(feature = "env", since = "1.0.0")]
 pub unsafe fn remove_var<K: AsRef<OsStr>>(key: K) {
     _remove_var(key.as_ref())
 }
 
-#[cfg(bootstrap)]
-#[allow(missing_docs)]
-#[stable(feature = "env", since = "1.0.0")]
-pub fn remove_var<K: AsRef<OsStr>>(key: K) {
-    unsafe { _remove_var(key.as_ref()) }
-}
-
 unsafe fn _remove_var(key: &OsStr) {
     os_imp::unsetenv(key)
         .unwrap_or_else(|e| panic!("failed to remove environment variable `{key:?}`: {e}"))
diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
index 66692a2a2cb..a3a4d552c63 100644
--- a/src/bootstrap/src/core/build_steps/compile.rs
+++ b/src/bootstrap/src/core/build_steps/compile.rs
@@ -1008,10 +1008,7 @@ pub fn rustc_cargo(
 
     // If the rustc output is piped to e.g. `head -n1` we want the process to be
     // killed, rather than having an error bubble up and cause a panic.
-    // FIXME: Synthetic #[cfg(bootstrap)]. Remove when the bootstrap compiler supports it.
-    if compiler.stage != 0 {
-        cargo.rustflag("-Zon-broken-pipe=kill");
-    }
+    cargo.rustflag("-Zon-broken-pipe=kill");
 
     // We currently don't support cross-crate LTO in stage0. This also isn't hugely necessary
     // and may just be a time sink.
diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs
index 9df4698f21f..47bed6269db 100644
--- a/src/bootstrap/src/core/build_steps/tool.rs
+++ b/src/bootstrap/src/core/build_steps/tool.rs
@@ -521,10 +521,7 @@ impl Step for Rustdoc {
         // If the rustdoc output is piped to e.g. `head -n1` we want the process
         // to be killed, rather than having an error bubble up and cause a
         // panic.
-        // FIXME: Synthetic #[cfg(bootstrap)]. Remove when the bootstrap compiler supports it.
-        if build_compiler.stage > 0 {
-            cargo.rustflag("-Zon-broken-pipe=kill");
-        }
+        cargo.rustflag("-Zon-broken-pipe=kill");
 
         let _guard = builder.msg_tool(
             Kind::Build,