Skip to content

Commit 5b08c9f

Browse files
stage-step cfgs
1 parent 17887f7 commit 5b08c9f

File tree

7 files changed

+9
-50
lines changed

7 files changed

+9
-50
lines changed

library/core/src/cmp.rs

+3-37
Original file line numberDiff line numberDiff line change
@@ -798,16 +798,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
798798
Self: Sized,
799799
Self: ~const Destruct,
800800
{
801-
#[cfg(not(bootstrap))]
802-
{
803-
max_by(self, other, Ord::cmp)
804-
}
805-
806-
#[cfg(bootstrap)]
807-
match self.cmp(&other) {
808-
Ordering::Less | Ordering::Equal => other,
809-
Ordering::Greater => self,
810-
}
801+
max_by(self, other, Ord::cmp)
811802
}
812803

813804
/// Compares and returns the minimum of two values.
@@ -828,16 +819,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
828819
Self: Sized,
829820
Self: ~const Destruct,
830821
{
831-
#[cfg(not(bootstrap))]
832-
{
833-
min_by(self, other, Ord::cmp)
834-
}
835-
836-
#[cfg(bootstrap)]
837-
match self.cmp(&other) {
838-
Ordering::Less | Ordering::Equal => self,
839-
Ordering::Greater => other,
840-
}
822+
min_by(self, other, Ord::cmp)
841823
}
842824

843825
/// Restrict a value to a certain interval.
@@ -1234,23 +1216,7 @@ where
12341216
F: ~const Destruct,
12351217
K: ~const Destruct,
12361218
{
1237-
cfg_if! {
1238-
if #[cfg(bootstrap)] {
1239-
const fn imp<T, F: ~const FnMut(&T) -> K, K: ~const Ord>(
1240-
f: &mut F,
1241-
(v1, v2): (&T, &T),
1242-
) -> Ordering
1243-
where
1244-
T: ~const Destruct,
1245-
K: ~const Destruct,
1246-
{
1247-
f(v1).cmp(&f(v2))
1248-
}
1249-
min_by(v1, v2, ConstFnMutClosure::new(&mut f, imp))
1250-
} else {
1251-
min_by(v1, v2, const |v1, v2| f(v1).cmp(&f(v2)))
1252-
}
1253-
}
1219+
min_by(v1, v2, const |v1, v2| f(v1).cmp(&f(v2)))
12541220
}
12551221

12561222
/// Compares and returns the maximum of two values.

library/core/src/intrinsics.rs

-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ use crate::marker::DiscriminantKind;
5858
use crate::marker::Tuple;
5959
use crate::mem;
6060

61-
#[cfg(not(bootstrap))]
6261
pub mod mir;
6362

6463
// These imports are used for simplifying intra-doc links
@@ -963,7 +962,6 @@ extern "rust-intrinsic" {
963962
/// This intrinsic does not have a stable counterpart.
964963
#[rustc_const_unstable(feature = "const_assert_type2", issue = "none")]
965964
#[rustc_safe_intrinsic]
966-
#[cfg(not(bootstrap))]
967965
pub fn assert_mem_uninitialized_valid<T>();
968966

969967
/// Gets a reference to a static `Location` indicating where it was called.

library/core/src/intrinsics/mir.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@
6060
//!
6161
//! # Examples
6262
//!
63-
#![cfg_attr(bootstrap, doc = "```rust,compile_fail")]
64-
#![cfg_attr(not(bootstrap), doc = "```rust")]
63+
//! ```rust
6564
//! #![feature(core_intrinsics, custom_mir)]
6665
//!
6766
//! extern crate core;
@@ -294,8 +293,7 @@ define!(
294293
///
295294
/// # Examples
296295
///
297-
#[cfg_attr(bootstrap, doc = "```rust,compile_fail")]
298-
#[cfg_attr(not(bootstrap), doc = "```rust")]
296+
/// ```rust
299297
/// #![feature(custom_mir, core_intrinsics)]
300298
///
301299
/// extern crate core;

library/core/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@
191191
#![feature(cfg_sanitize)]
192192
#![feature(cfg_target_has_atomic)]
193193
#![feature(cfg_target_has_atomic_equal_alignment)]
194-
#![cfg_attr(not(bootstrap), feature(const_closures))]
194+
#![feature(const_closures)]
195195
#![feature(const_fn_floating_point_arithmetic)]
196196
#![feature(const_mut_refs)]
197197
#![feature(const_precise_live_drops)]
@@ -248,7 +248,6 @@
248248
#![feature(sse4a_target_feature)]
249249
#![feature(tbm_target_feature)]
250250
#![feature(wasm_target_feature)]
251-
#![cfg_attr(bootstrap, feature(f16c_target_feature))]
252251

253252
// allow using `core::` in intra-doc links
254253
#[allow(unused_extern_crates)]

library/core/src/mem/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,6 @@ pub unsafe fn zeroed<T>() -> T {
682682
pub unsafe fn uninitialized<T>() -> T {
683683
// SAFETY: the caller must guarantee that an uninitialized value is valid for `T`.
684684
unsafe {
685-
#[cfg(not(bootstrap))] // If the compiler hits this itself then it deserves the UB.
686685
intrinsics::assert_mem_uninitialized_valid::<T>();
687686
let mut val = MaybeUninit::<T>::uninit();
688687

library/core/src/panicking.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ pub const fn panic(expr: &'static str) -> ! {
117117
/// Like `panic`, but without unwinding and track_caller to reduce the impact on codesize.
118118
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never), cold)]
119119
#[cfg_attr(feature = "panic_immediate_abort", inline)]
120-
#[cfg_attr(not(bootstrap), lang = "panic_nounwind")] // needed by codegen for non-unwinding panics
120+
#[lang = "panic_nounwind"] // needed by codegen for non-unwinding panics
121121
#[rustc_nounwind]
122122
pub fn panic_nounwind(expr: &'static str) -> ! {
123123
panic_nounwind_fmt(fmt::Arguments::new_v1(&[expr], &[]));
@@ -165,8 +165,7 @@ fn panic_bounds_check(index: usize, len: usize) -> ! {
165165
/// any extra arguments (including those synthesized by track_caller).
166166
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never), cold)]
167167
#[cfg_attr(feature = "panic_immediate_abort", inline)]
168-
#[cfg_attr(bootstrap, lang = "panic_no_unwind")] // needed by codegen for panic in nounwind function
169-
#[cfg_attr(not(bootstrap), lang = "panic_cannot_unwind")] // needed by codegen for panic in nounwind function
168+
#[lang = "panic_cannot_unwind"] // needed by codegen for panic in nounwind function
170169
#[rustc_nounwind]
171170
fn panic_cannot_unwind() -> ! {
172171
panic_nounwind("panic in a function that cannot unwind")

library/core/src/task/wake.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ impl RawWakerVTable {
174174
/// Currently, `Context` only serves to provide access to a [`&Waker`](Waker)
175175
/// which can be used to wake the current task.
176176
#[stable(feature = "futures_api", since = "1.36.0")]
177-
#[cfg_attr(not(bootstrap), lang = "Context")]
177+
#[lang = "Context"]
178178
pub struct Context<'a> {
179179
waker: &'a Waker,
180180
// Ensure we future-proof against variance changes by forcing

0 commit comments

Comments
 (0)