Skip to content

Commit c8a0f69

Browse files
authored
Rollup merge of rust-lang#141925 - cuviper:vestigial-bootstrap, r=workingjubilee
Remove bootstrap cfgs from library/ These `cfg(bootstrap)` are always false now that rust-lang#119899 has landed, and likewise `cfg(not(bootstrap))` is always true. Therefore, we don't need to wait for the usual stage0 bump to clean these up.
2 parents f574c0e + c87b072 commit c8a0f69

File tree

13 files changed

+14
-134
lines changed

13 files changed

+14
-134
lines changed

library/alloc/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ optimize_for_size = ["core/optimize_for_size"]
3232
[lints.rust.unexpected_cfgs]
3333
level = "warn"
3434
check-cfg = [
35-
'cfg(bootstrap)',
3635
'cfg(no_global_oom_handling)',
3736
'cfg(no_rc)',
3837
'cfg(no_sync)',

library/alloc/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
)]
6767
#![doc(cfg_hide(
6868
not(test),
69-
not(any(test, bootstrap)),
7069
no_global_oom_handling,
7170
not(no_global_oom_handling),
7271
not(no_rc),

library/alloctests/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ harness = false
3939
[lints.rust.unexpected_cfgs]
4040
level = "warn"
4141
check-cfg = [
42-
'cfg(bootstrap)',
4342
'cfg(no_global_oom_handling)',
4443
'cfg(no_rc)',
4544
'cfg(no_sync)',

library/core/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ debug_typeid = []
2929
[lints.rust.unexpected_cfgs]
3030
level = "warn"
3131
check-cfg = [
32-
'cfg(bootstrap)',
3332
'cfg(no_fp_fmt_parse)',
3433
# core use #[path] imports to portable-simd `core_simd` crate
3534
# and to stdarch `core_arch` crate which messes-up with Cargo list

library/core/src/intrinsics/mod.rs

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -413,38 +413,7 @@ pub unsafe fn atomic_cxchgweak_seqcst_seqcst<T: Copy>(dst: *mut T, old: T, src:
413413
/// [`atomic`] types via the `load` method. For example, [`AtomicBool::load`].
414414
#[rustc_intrinsic]
415415
#[rustc_nounwind]
416-
#[cfg(not(bootstrap))]
417416
pub unsafe fn atomic_load<T: Copy, const ORD: AtomicOrdering>(src: *const T) -> T;
418-
/// Loads the current value of the pointer.
419-
/// `T` must be an integer or pointer type.
420-
///
421-
/// The stabilized version of this intrinsic is available on the
422-
/// [`atomic`] types via the `load` method by passing
423-
/// [`Ordering::SeqCst`] as the `order`. For example, [`AtomicBool::load`].
424-
#[rustc_intrinsic]
425-
#[rustc_nounwind]
426-
#[cfg(bootstrap)]
427-
pub unsafe fn atomic_load_seqcst<T: Copy>(src: *const T) -> T;
428-
/// Loads the current value of the pointer.
429-
/// `T` must be an integer or pointer type.
430-
///
431-
/// The stabilized version of this intrinsic is available on the
432-
/// [`atomic`] types via the `load` method by passing
433-
/// [`Ordering::Acquire`] as the `order`. For example, [`AtomicBool::load`].
434-
#[rustc_intrinsic]
435-
#[rustc_nounwind]
436-
#[cfg(bootstrap)]
437-
pub unsafe fn atomic_load_acquire<T: Copy>(src: *const T) -> T;
438-
/// Loads the current value of the pointer.
439-
/// `T` must be an integer or pointer type.
440-
///
441-
/// The stabilized version of this intrinsic is available on the
442-
/// [`atomic`] types via the `load` method by passing
443-
/// [`Ordering::Relaxed`] as the `order`. For example, [`AtomicBool::load`].
444-
#[rustc_intrinsic]
445-
#[rustc_nounwind]
446-
#[cfg(bootstrap)]
447-
pub unsafe fn atomic_load_relaxed<T: Copy>(src: *const T) -> T;
448417

449418
/// Stores the value at the specified memory location.
450419
/// `T` must be an integer or pointer type.
@@ -1767,7 +1736,6 @@ pub const unsafe fn arith_offset<T>(dst: *const T, offset: isize) -> *const T;
17671736
/// - `index < PtrMetadata(slice_ptr)`, so the indexing is in-bounds for the slice
17681737
/// - the resulting offsetting is in-bounds of the allocated object, which is
17691738
/// always the case for references, but needs to be upheld manually for pointers
1770-
#[cfg(not(bootstrap))]
17711739
#[rustc_nounwind]
17721740
#[rustc_intrinsic]
17731741
pub const unsafe fn slice_get_unchecked<
@@ -3710,7 +3678,7 @@ pub const fn minnumf128(x: f128, y: f128) -> f128;
37103678
/// Therefore, implementations must not require the user to uphold
37113679
/// any safety invariants.
37123680
#[rustc_nounwind]
3713-
#[cfg_attr(not(bootstrap), rustc_intrinsic)]
3681+
#[rustc_intrinsic]
37143682
pub const fn minimumf16(x: f16, y: f16) -> f16 {
37153683
if x < y {
37163684
x
@@ -3731,7 +3699,7 @@ pub const fn minimumf16(x: f16, y: f16) -> f16 {
37313699
/// Therefore, implementations must not require the user to uphold
37323700
/// any safety invariants.
37333701
#[rustc_nounwind]
3734-
#[cfg_attr(not(bootstrap), rustc_intrinsic)]
3702+
#[rustc_intrinsic]
37353703
pub const fn minimumf32(x: f32, y: f32) -> f32 {
37363704
if x < y {
37373705
x
@@ -3752,7 +3720,7 @@ pub const fn minimumf32(x: f32, y: f32) -> f32 {
37523720
/// Therefore, implementations must not require the user to uphold
37533721
/// any safety invariants.
37543722
#[rustc_nounwind]
3755-
#[cfg_attr(not(bootstrap), rustc_intrinsic)]
3723+
#[rustc_intrinsic]
37563724
pub const fn minimumf64(x: f64, y: f64) -> f64 {
37573725
if x < y {
37583726
x
@@ -3773,7 +3741,7 @@ pub const fn minimumf64(x: f64, y: f64) -> f64 {
37733741
/// Therefore, implementations must not require the user to uphold
37743742
/// any safety invariants.
37753743
#[rustc_nounwind]
3776-
#[cfg_attr(not(bootstrap), rustc_intrinsic)]
3744+
#[rustc_intrinsic]
37773745
pub const fn minimumf128(x: f128, y: f128) -> f128 {
37783746
if x < y {
37793747
x
@@ -3848,7 +3816,7 @@ pub const fn maxnumf128(x: f128, y: f128) -> f128;
38483816
/// Therefore, implementations must not require the user to uphold
38493817
/// any safety invariants.
38503818
#[rustc_nounwind]
3851-
#[cfg_attr(not(bootstrap), rustc_intrinsic)]
3819+
#[rustc_intrinsic]
38523820
pub const fn maximumf16(x: f16, y: f16) -> f16 {
38533821
if x > y {
38543822
x
@@ -3868,7 +3836,7 @@ pub const fn maximumf16(x: f16, y: f16) -> f16 {
38683836
/// Therefore, implementations must not require the user to uphold
38693837
/// any safety invariants.
38703838
#[rustc_nounwind]
3871-
#[cfg_attr(not(bootstrap), rustc_intrinsic)]
3839+
#[rustc_intrinsic]
38723840
pub const fn maximumf32(x: f32, y: f32) -> f32 {
38733841
if x > y {
38743842
x
@@ -3888,7 +3856,7 @@ pub const fn maximumf32(x: f32, y: f32) -> f32 {
38883856
/// Therefore, implementations must not require the user to uphold
38893857
/// any safety invariants.
38903858
#[rustc_nounwind]
3891-
#[cfg_attr(not(bootstrap), rustc_intrinsic)]
3859+
#[rustc_intrinsic]
38923860
pub const fn maximumf64(x: f64, y: f64) -> f64 {
38933861
if x > y {
38943862
x
@@ -3908,7 +3876,7 @@ pub const fn maximumf64(x: f64, y: f64) -> f64 {
39083876
/// Therefore, implementations must not require the user to uphold
39093877
/// any safety invariants.
39103878
#[rustc_nounwind]
3911-
#[cfg_attr(not(bootstrap), rustc_intrinsic)]
3879+
#[rustc_intrinsic]
39123880
pub const fn maximumf128(x: f128, y: f128) -> f128 {
39133881
if x > y {
39143882
x

library/core/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@
187187
//
188188
// Target features:
189189
// tidy-alphabetical-start
190-
#![cfg_attr(bootstrap, feature(avx512_target_feature))]
191190
#![feature(aarch64_unstable_target_feature)]
192191
#![feature(arm_target_feature)]
193192
#![feature(hexagon_target_feature)]
@@ -225,7 +224,6 @@ pub mod assert_matches {
225224

226225
// We don't export this through #[macro_export] for now, to avoid breakage.
227226
#[unstable(feature = "autodiff", issue = "124509")]
228-
#[cfg(not(bootstrap))]
229227
/// Unstable module containing the unstable `autodiff` macro.
230228
pub mod autodiff {
231229
#[unstable(feature = "autodiff", issue = "124509")]

library/core/src/macros/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,7 +1533,6 @@ pub(crate) mod builtin {
15331533
#[unstable(feature = "autodiff", issue = "124509")]
15341534
#[allow_internal_unstable(rustc_attrs)]
15351535
#[rustc_builtin_macro]
1536-
#[cfg(not(bootstrap))]
15371536
pub macro autodiff_forward($item:item) {
15381537
/* compiler built-in */
15391538
}
@@ -1552,7 +1551,6 @@ pub(crate) mod builtin {
15521551
#[unstable(feature = "autodiff", issue = "124509")]
15531552
#[allow_internal_unstable(rustc_attrs)]
15541553
#[rustc_builtin_macro]
1555-
#[cfg(not(bootstrap))]
15561554
pub macro autodiff_reverse($item:item) {
15571555
/* compiler built-in */
15581556
}

library/core/src/pin.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,6 @@ pub use self::unsafe_pinned::UnsafePinned;
10921092
#[rustc_pub_transparent]
10931093
#[derive(Copy, Clone)]
10941094
pub struct Pin<Ptr> {
1095-
/// Only public for bootstrap.
10961095
pointer: Ptr,
10971096
}
10981097

library/core/src/slice/index.rs

Lines changed: 4 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Indexing implementations for `[T]`.
22
3-
#[cfg(not(bootstrap))]
43
use crate::intrinsics::slice_get_unchecked;
54
use crate::panic::const_panic;
65
use crate::ub_checks::assert_unsafe_precondition;
@@ -85,22 +84,6 @@ const fn slice_end_index_overflow_fail() -> ! {
8584
// Both the safe and unsafe public methods share these helpers,
8685
// which use intrinsics directly to get *no* extra checks.
8786

88-
#[cfg(bootstrap)]
89-
#[inline(always)]
90-
const unsafe fn get_noubcheck<T>(ptr: *const [T], index: usize) -> *const T {
91-
let ptr = ptr as *const T;
92-
// SAFETY: The caller already checked these preconditions
93-
unsafe { crate::intrinsics::offset(ptr, index) }
94-
}
95-
96-
#[cfg(bootstrap)]
97-
#[inline(always)]
98-
const unsafe fn get_mut_noubcheck<T>(ptr: *mut [T], index: usize) -> *mut T {
99-
let ptr = ptr as *mut T;
100-
// SAFETY: The caller already checked these preconditions
101-
unsafe { crate::intrinsics::offset(ptr, index) }
102-
}
103-
10487
#[inline(always)]
10588
const unsafe fn get_offset_len_noubcheck<T>(
10689
ptr: *const [T],
@@ -231,16 +214,8 @@ unsafe impl<T> SliceIndex<[T]> for usize {
231214
#[inline]
232215
fn get(self, slice: &[T]) -> Option<&T> {
233216
if self < slice.len() {
234-
#[cfg(bootstrap)]
235-
// SAFETY: `self` is checked to be in bounds.
236-
unsafe {
237-
Some(&*get_noubcheck(slice, self))
238-
}
239-
#[cfg(not(bootstrap))]
240217
// SAFETY: `self` is checked to be in bounds.
241-
unsafe {
242-
Some(slice_get_unchecked(slice, self))
243-
}
218+
unsafe { Some(slice_get_unchecked(slice, self)) }
244219
} else {
245220
None
246221
}
@@ -249,16 +224,8 @@ unsafe impl<T> SliceIndex<[T]> for usize {
249224
#[inline]
250225
fn get_mut(self, slice: &mut [T]) -> Option<&mut T> {
251226
if self < slice.len() {
252-
#[cfg(bootstrap)]
253227
// SAFETY: `self` is checked to be in bounds.
254-
unsafe {
255-
Some(&mut *get_mut_noubcheck(slice, self))
256-
}
257-
#[cfg(not(bootstrap))]
258-
// SAFETY: `self` is checked to be in bounds.
259-
unsafe {
260-
Some(slice_get_unchecked(slice, self))
261-
}
228+
unsafe { Some(slice_get_unchecked(slice, self)) }
262229
} else {
263230
None
264231
}
@@ -280,14 +247,7 @@ unsafe impl<T> SliceIndex<[T]> for usize {
280247
// Use intrinsics::assume instead of hint::assert_unchecked so that we don't check the
281248
// precondition of this function twice.
282249
crate::intrinsics::assume(self < slice.len());
283-
#[cfg(bootstrap)]
284-
{
285-
get_noubcheck(slice, self)
286-
}
287-
#[cfg(not(bootstrap))]
288-
{
289-
slice_get_unchecked(slice, self)
290-
}
250+
slice_get_unchecked(slice, self)
291251
}
292252
}
293253

@@ -300,16 +260,7 @@ unsafe impl<T> SliceIndex<[T]> for usize {
300260
(this: usize = self, len: usize = slice.len()) => this < len
301261
);
302262
// SAFETY: see comments for `get_unchecked` above.
303-
unsafe {
304-
#[cfg(bootstrap)]
305-
{
306-
get_mut_noubcheck(slice, self)
307-
}
308-
#[cfg(not(bootstrap))]
309-
{
310-
slice_get_unchecked(slice, self)
311-
}
312-
}
263+
unsafe { slice_get_unchecked(slice, self) }
313264
}
314265

315266
#[inline]

library/core/src/sync/atomic.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3822,23 +3822,6 @@ unsafe fn atomic_store<T: Copy>(dst: *mut T, val: T, order: Ordering) {
38223822

38233823
#[inline]
38243824
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
3825-
#[cfg(bootstrap)]
3826-
unsafe fn atomic_load<T: Copy>(dst: *const T, order: Ordering) -> T {
3827-
// SAFETY: the caller must uphold the safety contract for `atomic_load`.
3828-
unsafe {
3829-
match order {
3830-
Relaxed => intrinsics::atomic_load_relaxed(dst),
3831-
Acquire => intrinsics::atomic_load_acquire(dst),
3832-
SeqCst => intrinsics::atomic_load_seqcst(dst),
3833-
Release => panic!("there is no such thing as a release load"),
3834-
AcqRel => panic!("there is no such thing as an acquire-release load"),
3835-
}
3836-
}
3837-
}
3838-
3839-
#[inline]
3840-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
3841-
#[cfg(not(bootstrap))]
38423825
unsafe fn atomic_load<T: Copy>(dst: *const T, order: Ordering) -> T {
38433826
use intrinsics::AtomicOrdering;
38443827
// SAFETY: the caller must uphold the safety contract for `atomic_load`.

library/coretests/tests/num/mod.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,6 @@ macro_rules! test_float {
951951
assert!(<$fty>::NAN.div_euclid(<$fty>::INFINITY).is_nan());
952952
}
953953
#[test]
954-
#[cfg(not(bootstrap))]
955954
fn floor() {
956955
$fassert!((0.0 as $fty).floor(), 0.0);
957956
$fassert!((0.0 as $fty).floor().is_sign_positive());
@@ -969,7 +968,6 @@ macro_rules! test_float {
969968
$fassert!(<$fty>::NEG_INFINITY.floor(), <$fty>::NEG_INFINITY);
970969
}
971970
#[test]
972-
#[cfg(not(bootstrap))]
973971
fn ceil() {
974972
$fassert!((0.0 as $fty).ceil(), 0.0);
975973
$fassert!((0.0 as $fty).ceil().is_sign_positive());
@@ -986,7 +984,6 @@ macro_rules! test_float {
986984
$fassert!(<$fty>::NEG_INFINITY.ceil(), <$fty>::NEG_INFINITY);
987985
}
988986
#[test]
989-
#[cfg(not(bootstrap))]
990987
fn round() {
991988
$fassert!((0.0 as $fty).round(), 0.0);
992989
$fassert!((0.0 as $fty).round().is_sign_positive());
@@ -1003,7 +1000,6 @@ macro_rules! test_float {
10031000
$fassert!(<$fty>::NEG_INFINITY.round(), <$fty>::NEG_INFINITY);
10041001
}
10051002
#[test]
1006-
#[cfg(not(bootstrap))]
10071003
fn round_ties_even() {
10081004
$fassert!((0.0 as $fty).round_ties_even(), 0.0);
10091005
$fassert!((0.0 as $fty).round_ties_even().is_sign_positive());
@@ -1022,7 +1018,6 @@ macro_rules! test_float {
10221018
$fassert!(<$fty>::NEG_INFINITY.round_ties_even(), <$fty>::NEG_INFINITY);
10231019
}
10241020
#[test]
1025-
#[cfg(not(bootstrap))]
10261021
fn trunc() {
10271022
$fassert!((0.0 as $fty).trunc(), 0.0);
10281023
$fassert!((0.0 as $fty).trunc().is_sign_positive());
@@ -1041,7 +1036,6 @@ macro_rules! test_float {
10411036
$fassert!(<$fty>::NEG_INFINITY.trunc(), <$fty>::NEG_INFINITY);
10421037
}
10431038
#[test]
1044-
#[cfg(not(bootstrap))]
10451039
fn fract() {
10461040
$fassert!((0.0 as $fty).fract(), 0.0);
10471041
$fassert!((0.0 as $fty).fract().is_sign_positive());

library/std/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ test = true
157157
[lints.rust.unexpected_cfgs]
158158
level = "warn"
159159
check-cfg = [
160-
'cfg(bootstrap)',
161160
# std use #[path] imports to portable-simd `std_float` crate
162161
# and to the `backtrace` crate which messes-up with Cargo list
163162
# of declared features, we therefor expect any feature cfg

0 commit comments

Comments
 (0)