Skip to content

Commit 647d9b5

Browse files
apply bootstrap cfgs
1 parent 6c50ae8 commit 647d9b5

File tree

31 files changed

+13
-77
lines changed

31 files changed

+13
-77
lines changed

src/bootstrap/compile.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,7 @@ fn copy_self_contained_objects(
159159
compiler: &Compiler,
160160
target: Interned<String>,
161161
) -> Vec<(PathBuf, DependencyType)> {
162-
// cfg(bootstrap)
163-
// Remove when upgrading bootstrap compiler.
164-
let libdir_self_contained = if compiler.stage == 0 {
165-
builder.sysroot_libdir(*compiler, target).to_path_buf()
166-
} else {
167-
builder.sysroot_libdir(*compiler, target).join("self-contained")
168-
};
162+
let libdir_self_contained = builder.sysroot_libdir(*compiler, target).join("self-contained");
169163
t!(fs::create_dir_all(&libdir_self_contained));
170164
let mut target_deps = vec![];
171165

src/liballoc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787
#![feature(const_generic_impls_guard)]
8888
#![feature(const_generics)]
8989
#![feature(const_in_array_repeat_expressions)]
90-
#![cfg_attr(bootstrap, feature(const_if_match))]
9190
#![feature(cow_is_borrowed)]
9291
#![feature(deque_range)]
9392
#![feature(dispatch_from_dyn)]

src/libcore/intrinsics.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1927,7 +1927,6 @@ extern "rust-intrinsic" {
19271927
/// The to-be-stabilized version of this intrinsic is
19281928
/// [`std::mem::variant_count`](../../std/mem/fn.variant_count.html)
19291929
#[rustc_const_unstable(feature = "variant_count", issue = "73662")]
1930-
#[cfg(not(bootstrap))]
19311930
pub fn variant_count<T>() -> usize;
19321931

19331932
/// Rust's "try catch" construct which invokes the function pointer `try_fn`
@@ -1958,7 +1957,6 @@ extern "rust-intrinsic" {
19581957
/// Internal placeholder for injecting code coverage counters when the "instrument-coverage"
19591958
/// option is enabled. The placeholder is replaced with `llvm.instrprof.increment` during code
19601959
/// generation.
1961-
#[cfg(not(bootstrap))]
19621960
#[lang = "count_code_region"]
19631961
pub fn count_code_region(index: u32, start_byte_pos: u32, end_byte_pos: u32);
19641962

@@ -1968,7 +1966,6 @@ extern "rust-intrinsic" {
19681966
/// "coverage map", which is injected into the generated code, as additional data.
19691967
/// This marker identifies a code region and two other counters or counter expressions
19701968
/// whose sum is the number of times the code region was executed.
1971-
#[cfg(not(bootstrap))]
19721969
pub fn coverage_counter_add(
19731970
index: u32,
19741971
left_index: u32,
@@ -1980,7 +1977,6 @@ extern "rust-intrinsic" {
19801977
/// This marker identifies a code region and two other counters or counter expressions
19811978
/// whose difference is the number of times the code region was executed.
19821979
/// (See `coverage_counter_add` for more information.)
1983-
#[cfg(not(bootstrap))]
19841980
pub fn coverage_counter_subtract(
19851981
index: u32,
19861982
left_index: u32,
@@ -1992,17 +1988,14 @@ extern "rust-intrinsic" {
19921988
/// This marker identifies a code region to be added to the "coverage map" to indicate source
19931989
/// code that can never be reached.
19941990
/// (See `coverage_counter_add` for more information.)
1995-
#[cfg(not(bootstrap))]
19961991
pub fn coverage_unreachable(start_byte_pos: u32, end_byte_pos: u32);
19971992

19981993
/// See documentation of `<*const T>::guaranteed_eq` for details.
19991994
#[rustc_const_unstable(feature = "const_raw_ptr_comparison", issue = "53020")]
2000-
#[cfg(not(bootstrap))]
20011995
pub fn ptr_guaranteed_eq<T>(ptr: *const T, other: *const T) -> bool;
20021996

20031997
/// See documentation of `<*const T>::guaranteed_ne` for details.
20041998
#[rustc_const_unstable(feature = "const_raw_ptr_comparison", issue = "53020")]
2005-
#[cfg(not(bootstrap))]
20061999
pub fn ptr_guaranteed_ne<T>(ptr: *const T, other: *const T) -> bool;
20072000
}
20082001

src/libcore/lib.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@
7373
#![feature(const_ascii_ctype_on_intrinsics)]
7474
#![feature(const_alloc_layout)]
7575
#![feature(const_discriminant)]
76-
#![cfg_attr(bootstrap, feature(const_if_match))]
77-
#![cfg_attr(bootstrap, feature(const_loop))]
7876
#![feature(const_checked_int_methods)]
7977
#![feature(const_euclidean_int_methods)]
8078
#![feature(const_overflowing_int_methods)]
@@ -87,7 +85,7 @@
8785
#![feature(const_generics)]
8886
#![feature(const_ptr_offset)]
8987
#![feature(const_ptr_offset_from)]
90-
#![cfg_attr(not(bootstrap), feature(const_raw_ptr_comparison))]
88+
#![feature(const_raw_ptr_comparison)]
9189
#![feature(const_result)]
9290
#![feature(const_slice_from_raw_parts)]
9391
#![feature(const_slice_ptr_len)]
@@ -120,13 +118,12 @@
120118
#![feature(staged_api)]
121119
#![feature(std_internals)]
122120
#![feature(stmt_expr_attributes)]
123-
#![cfg_attr(bootstrap, feature(track_caller))]
124121
#![feature(transparent_unions)]
125122
#![feature(unboxed_closures)]
126123
#![feature(unsized_locals)]
127124
#![feature(untagged_unions)]
128125
#![feature(unwind_attributes)]
129-
#![cfg_attr(not(bootstrap), feature(variant_count))]
126+
#![feature(variant_count)]
130127
#![feature(doc_alias)]
131128
#![feature(mmx_target_feature)]
132129
#![feature(tbm_target_feature)]
@@ -141,7 +138,7 @@
141138
#![feature(rtm_target_feature)]
142139
#![feature(f16c_target_feature)]
143140
#![feature(hexagon_target_feature)]
144-
#![cfg_attr(not(bootstrap), feature(const_fn_transmute))]
141+
#![feature(const_fn_transmute)]
145142
#![feature(abi_unadjusted)]
146143
#![feature(adx_target_feature)]
147144
#![feature(maybe_uninit_slice)]
@@ -292,7 +289,7 @@ pub mod primitive;
292289
)]
293290
// FIXME: This annotation should be moved into rust-lang/stdarch after clashing_extern_declarations is
294291
// merged. It currently cannot because bootstrap fails as the lint hasn't been defined yet.
295-
#[cfg_attr(not(bootstrap), allow(clashing_extern_declarations))]
292+
#[allow(clashing_extern_declarations)]
296293
#[unstable(feature = "stdsimd", issue = "48556")]
297294
mod core_arch;
298295

src/libcore/mem/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,6 @@ pub const fn discriminant<T>(v: &T) -> Discriminant<T> {
10371037
/// assert_eq!(mem::variant_count::<Result<!, !>>(), 2);
10381038
/// ```
10391039
#[inline(always)]
1040-
#[cfg(not(bootstrap))]
10411040
#[unstable(feature = "variant_count", issue = "73662")]
10421041
#[rustc_const_unstable(feature = "variant_count", issue = "73662")]
10431042
pub const fn variant_count<T>() -> usize {

src/libcore/num/mod.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@ macro_rules! try_opt {
2121
};
2222
}
2323

24-
#[cfg(bootstrap)]
25-
macro_rules! unlikely {
26-
($e: expr) => {
27-
$e
28-
};
29-
}
30-
31-
#[cfg(not(bootstrap))]
3224
#[allow_internal_unstable(const_likely)]
3325
macro_rules! unlikely {
3426
($e: expr) => {
@@ -1600,7 +1592,6 @@ $EndFeature, "
16001592
#[stable(feature = "no_panic_abs", since = "1.13.0")]
16011593
#[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")]
16021594
#[allow(unused_attributes)]
1603-
#[cfg_attr(bootstrap, allow_internal_unstable(const_if_match))]
16041595
#[inline]
16051596
pub const fn wrapping_abs(self) -> Self {
16061597
if self.is_negative() {
@@ -1889,7 +1880,6 @@ assert_eq!(", stringify!($SelfT), "::MIN.overflowing_neg(), (", stringify!($Self
18891880
#[stable(feature = "wrapping", since = "1.7.0")]
18901881
#[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")]
18911882
#[allow(unused_attributes)]
1892-
#[cfg_attr(bootstrap, allow_internal_unstable(const_if_match))]
18931883
pub const fn overflowing_neg(self) -> (Self, bool) {
18941884
if unlikely!(self == Self::MIN) {
18951885
(Self::MIN, true)
@@ -2182,7 +2172,6 @@ $EndFeature, "
21822172
#[stable(feature = "rust1", since = "1.0.0")]
21832173
#[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")]
21842174
#[allow(unused_attributes)]
2185-
#[cfg_attr(bootstrap, allow_internal_unstable(const_if_match))]
21862175
#[inline]
21872176
#[rustc_inherit_overflow_checks]
21882177
pub const fn abs(self) -> Self {

src/libcore/ops/function.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ pub trait FnMut<Args>: FnOnce<Args> {
224224
#[must_use = "closures are lazy and do nothing unless called"]
225225
pub trait FnOnce<Args> {
226226
/// The returned type after the call operator is used.
227-
#[cfg_attr(not(bootstrap), lang = "fn_once_output")]
227+
#[lang = "fn_once_output"]
228228
#[stable(feature = "fn_once_output", since = "1.12.0")]
229229
type Output;
230230

src/libcore/ptr/const_ptr.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,6 @@ impl<T: ?Sized> *const T {
324324
#[unstable(feature = "const_raw_ptr_comparison", issue = "53020")]
325325
#[rustc_const_unstable(feature = "const_raw_ptr_comparison", issue = "53020")]
326326
#[inline]
327-
#[cfg(not(bootstrap))]
328327
pub const fn guaranteed_eq(self, other: *const T) -> bool
329328
where
330329
T: Sized,
@@ -356,7 +355,6 @@ impl<T: ?Sized> *const T {
356355
#[unstable(feature = "const_raw_ptr_comparison", issue = "53020")]
357356
#[rustc_const_unstable(feature = "const_raw_ptr_comparison", issue = "53020")]
358357
#[inline]
359-
#[cfg(not(bootstrap))]
360358
pub const fn guaranteed_ne(self, other: *const T) -> bool
361359
where
362360
T: Sized,

src/libcore/ptr/mut_ptr.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ impl<T: ?Sized> *mut T {
305305
#[unstable(feature = "const_raw_ptr_comparison", issue = "53020")]
306306
#[rustc_const_unstable(feature = "const_raw_ptr_comparison", issue = "53020")]
307307
#[inline]
308-
#[cfg(not(bootstrap))]
309308
pub const fn guaranteed_eq(self, other: *mut T) -> bool
310309
where
311310
T: Sized,
@@ -337,7 +336,6 @@ impl<T: ?Sized> *mut T {
337336
#[unstable(feature = "const_raw_ptr_comparison", issue = "53020")]
338337
#[rustc_const_unstable(feature = "const_raw_ptr_comparison", issue = "53020")]
339338
#[inline]
340-
#[cfg(not(bootstrap))]
341339
pub const unsafe fn guaranteed_ne(self, other: *mut T) -> bool
342340
where
343341
T: Sized,

src/libcore/slice/mod.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6233,14 +6233,8 @@ where
62336233
return false;
62346234
}
62356235

6236-
#[cfg(bootstrap)]
6237-
if self.as_ptr() == other.as_ptr() {
6238-
return true;
6239-
}
6240-
62416236
// While performance would suffer if `guaranteed_eq` just returned `false`
62426237
// for all arguments, correctness and return value of this function are not affected.
6243-
#[cfg(not(bootstrap))]
62446238
if self.as_ptr().guaranteed_eq(other.as_ptr()) {
62456239
return true;
62466240
}
@@ -6259,14 +6253,8 @@ where
62596253
return false;
62606254
}
62616255

6262-
#[cfg(bootstrap)]
6263-
if self.as_ptr() == other.as_ptr() {
6264-
return true;
6265-
}
6266-
62676256
// While performance would suffer if `guaranteed_eq` just returned `false`
62686257
// for all arguments, correctness and return value of this function are not affected.
6269-
#[cfg(not(bootstrap))]
62706258
if self.as_ptr().guaranteed_eq(other.as_ptr()) {
62716259
return true;
62726260
}

0 commit comments

Comments
 (0)