]> git.lizzy.rs Git - rust.git/commitdiff
stage-step cfgs
authorMark Rousskov <mark.simulacrum@gmail.com>
Wed, 25 Jan 2023 14:48:32 +0000 (09:48 -0500)
committerMark Rousskov <mark.simulacrum@gmail.com>
Mon, 30 Jan 2023 18:09:09 +0000 (13:09 -0500)
library/core/src/cmp.rs
library/core/src/intrinsics.rs
library/core/src/intrinsics/mir.rs
library/core/src/lib.rs
library/core/src/mem/mod.rs
library/core/src/panicking.rs
library/core/src/task/wake.rs

index a7d6fec7d3dc1354121ea6058cb766bedc7affbe..b75ae996e4853b46219e4495f4ae08f1d5168fb6 100644 (file)
@@ -798,16 +798,7 @@ fn max(self, other: Self) -> Self
         Self: Sized,
         Self: ~const Destruct,
     {
-        #[cfg(not(bootstrap))]
-        {
-            max_by(self, other, Ord::cmp)
-        }
-
-        #[cfg(bootstrap)]
-        match self.cmp(&other) {
-            Ordering::Less | Ordering::Equal => other,
-            Ordering::Greater => self,
-        }
+        max_by(self, other, Ord::cmp)
     }
 
     /// Compares and returns the minimum of two values.
@@ -828,16 +819,7 @@ fn min(self, other: Self) -> Self
         Self: Sized,
         Self: ~const Destruct,
     {
-        #[cfg(not(bootstrap))]
-        {
-            min_by(self, other, Ord::cmp)
-        }
-
-        #[cfg(bootstrap)]
-        match self.cmp(&other) {
-            Ordering::Less | Ordering::Equal => self,
-            Ordering::Greater => other,
-        }
+        min_by(self, other, Ord::cmp)
     }
 
     /// Restrict a value to a certain interval.
@@ -1234,23 +1216,7 @@ pub const fn min_by_key<T, F: ~const FnMut(&T) -> K, K: ~const Ord>(v1: T, v2: T
     F: ~const Destruct,
     K: ~const Destruct,
 {
-    cfg_if! {
-        if #[cfg(bootstrap)] {
-            const fn imp<T, F: ~const FnMut(&T) -> K, K: ~const Ord>(
-                f: &mut F,
-                (v1, v2): (&T, &T),
-            ) -> Ordering
-            where
-                T: ~const Destruct,
-                K: ~const Destruct,
-            {
-                f(v1).cmp(&f(v2))
-            }
-            min_by(v1, v2, ConstFnMutClosure::new(&mut f, imp))
-        } else {
-            min_by(v1, v2, const |v1, v2| f(v1).cmp(&f(v2)))
-        }
-    }
+    min_by(v1, v2, const |v1, v2| f(v1).cmp(&f(v2)))
 }
 
 /// Compares and returns the maximum of two values.
index a315a28fb0d943f24deb882e1cdf8937637c5315..b1ed3b31e430c0a2badbeb41d5a75f51155debc0 100644 (file)
@@ -58,7 +58,6 @@
 use crate::marker::Tuple;
 use crate::mem;
 
-#[cfg(not(bootstrap))]
 pub mod mir;
 
 // These imports are used for simplifying intra-doc links
@@ -963,7 +962,6 @@ pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
     /// This intrinsic does not have a stable counterpart.
     #[rustc_const_unstable(feature = "const_assert_type2", issue = "none")]
     #[rustc_safe_intrinsic]
-    #[cfg(not(bootstrap))]
     pub fn assert_mem_uninitialized_valid<T>();
 
     /// Gets a reference to a static `Location` indicating where it was called.
index e3157b66902eb9dbfbfafbc505bdb786c88cbb2b..c0fd71ebae8a723a1c13cb81ea9a68d960550ac1 100644 (file)
@@ -60,8 +60,7 @@
 //!
 //! # Examples
 //!
-#![cfg_attr(bootstrap, doc = "```rust,compile_fail")]
-#![cfg_attr(not(bootstrap), doc = "```rust")]
+//! ```rust
 //! #![feature(core_intrinsics, custom_mir)]
 //!
 //! extern crate core;
@@ -294,8 +293,7 @@ fn Discriminant<T>(place: T) -> <T as ::core::marker::DiscriminantKind>::Discrim
     ///
     /// # Examples
     ///
-    #[cfg_attr(bootstrap, doc = "```rust,compile_fail")]
-    #[cfg_attr(not(bootstrap), doc = "```rust")]
+    /// ```rust
     /// #![feature(custom_mir, core_intrinsics)]
     ///
     /// extern crate core;
index 8790649abe6f1b90433171f95816072ecd05a4ca..80cd537906739ea9b8a061e06ce2fa3a14cea27b 100644 (file)
 #![feature(cfg_sanitize)]
 #![feature(cfg_target_has_atomic)]
 #![feature(cfg_target_has_atomic_equal_alignment)]
-#![cfg_attr(not(bootstrap), feature(const_closures))]
+#![feature(const_closures)]
 #![feature(const_fn_floating_point_arithmetic)]
 #![feature(const_mut_refs)]
 #![feature(const_precise_live_drops)]
 #![feature(sse4a_target_feature)]
 #![feature(tbm_target_feature)]
 #![feature(wasm_target_feature)]
-#![cfg_attr(bootstrap, feature(f16c_target_feature))]
 
 // allow using `core::` in intra-doc links
 #[allow(unused_extern_crates)]
index 5e01ccc07d8fdbf7d1b559004688fb8916311e1f..a67df7ed557a100dacac62db41470233ceab300d 100644 (file)
@@ -682,7 +682,6 @@ pub unsafe fn zeroed<T>() -> T {
 pub unsafe fn uninitialized<T>() -> T {
     // SAFETY: the caller must guarantee that an uninitialized value is valid for `T`.
     unsafe {
-        #[cfg(not(bootstrap))] // If the compiler hits this itself then it deserves the UB.
         intrinsics::assert_mem_uninitialized_valid::<T>();
         let mut val = MaybeUninit::<T>::uninit();
 
index 48e90e6d794005e7b9bde41b4ac440a93ade37f5..805a1e51ae9c09e6d583b295701706190e56a98d 100644 (file)
@@ -117,7 +117,7 @@ pub const fn panic(expr: &'static str) -> ! {
 /// Like `panic`, but without unwinding and track_caller to reduce the impact on codesize.
 #[cfg_attr(not(feature = "panic_immediate_abort"), inline(never), cold)]
 #[cfg_attr(feature = "panic_immediate_abort", inline)]
-#[cfg_attr(not(bootstrap), lang = "panic_nounwind")] // needed by codegen for non-unwinding panics
+#[lang = "panic_nounwind"] // needed by codegen for non-unwinding panics
 #[rustc_nounwind]
 pub fn panic_nounwind(expr: &'static str) -> ! {
     panic_nounwind_fmt(fmt::Arguments::new_v1(&[expr], &[]));
@@ -165,8 +165,7 @@ fn panic_bounds_check(index: usize, len: usize) -> ! {
 /// any extra arguments (including those synthesized by track_caller).
 #[cfg_attr(not(feature = "panic_immediate_abort"), inline(never), cold)]
 #[cfg_attr(feature = "panic_immediate_abort", inline)]
-#[cfg_attr(bootstrap, lang = "panic_no_unwind")] // needed by codegen for panic in nounwind function
-#[cfg_attr(not(bootstrap), lang = "panic_cannot_unwind")] // needed by codegen for panic in nounwind function
+#[lang = "panic_cannot_unwind"] // needed by codegen for panic in nounwind function
 #[rustc_nounwind]
 fn panic_cannot_unwind() -> ! {
     panic_nounwind("panic in a function that cannot unwind")
index 89adfccd90135233ef2ac66b533571bbbc3eeae5..808825326aef5372f139bc84630f08d3dc19cad5 100644 (file)
@@ -174,7 +174,7 @@ pub const fn new(
 /// Currently, `Context` only serves to provide access to a [`&Waker`](Waker)
 /// which can be used to wake the current task.
 #[stable(feature = "futures_api", since = "1.36.0")]
-#[cfg_attr(not(bootstrap), lang = "Context")]
+#[lang = "Context"]
 pub struct Context<'a> {
     waker: &'a Waker,
     // Ensure we future-proof against variance changes by forcing