Skip to content

Commit 7dd1036

Browse files
committed
update cfgs
1 parent 1575738 commit 7dd1036

File tree

17 files changed

+20
-128
lines changed

17 files changed

+20
-128
lines changed

Diff for: alloc/src/alloc.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,22 @@ unsafe extern "Rust" {
1616
// otherwise.
1717
#[rustc_allocator]
1818
#[rustc_nounwind]
19-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
19+
#[rustc_std_internal_symbol]
2020
fn __rust_alloc(size: usize, align: usize) -> *mut u8;
2121
#[rustc_deallocator]
2222
#[rustc_nounwind]
23-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
23+
#[rustc_std_internal_symbol]
2424
fn __rust_dealloc(ptr: *mut u8, size: usize, align: usize);
2525
#[rustc_reallocator]
2626
#[rustc_nounwind]
27-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
27+
#[rustc_std_internal_symbol]
2828
fn __rust_realloc(ptr: *mut u8, old_size: usize, align: usize, new_size: usize) -> *mut u8;
2929
#[rustc_allocator_zeroed]
3030
#[rustc_nounwind]
31-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
31+
#[rustc_std_internal_symbol]
3232
fn __rust_alloc_zeroed(size: usize, align: usize) -> *mut u8;
3333

34-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
34+
#[rustc_std_internal_symbol]
3535
static __rust_no_alloc_shim_is_unstable: u8;
3636
}
3737

@@ -360,7 +360,7 @@ unsafe extern "Rust" {
360360
// This is the magic symbol to call the global alloc error handler. rustc generates
361361
// it to call `__rg_oom` if there is a `#[alloc_error_handler]`, or to call the
362362
// default implementations below (`__rdl_oom`) otherwise.
363-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
363+
#[rustc_std_internal_symbol]
364364
fn __rust_alloc_error_handler(size: usize, align: usize) -> !;
365365
}
366366

@@ -427,7 +427,7 @@ pub mod __alloc_error_handler {
427427
unsafe extern "Rust" {
428428
// This symbol is emitted by rustc next to __rust_alloc_error_handler.
429429
// Its value depends on the -Zoom={panic,abort} compiler option.
430-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
430+
#[rustc_std_internal_symbol]
431431
static __rust_alloc_error_handler_should_panic: u8;
432432
}
433433

Diff for: core/Cargo.toml

-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ check-cfg = [
3232
'cfg(bootstrap)',
3333
'cfg(no_fp_fmt_parse)',
3434
'cfg(stdarch_intel_sde)',
35-
# #[cfg(bootstrap)]
36-
'cfg(target_feature, values("vector-enhancements-1"))',
3735
# core use #[path] imports to portable-simd `core_simd` crate
3836
# and to stdarch `core_arch` crate which messes-up with Cargo list
3937
# of declared features, we therefor expect any feature cfg

Diff for: core/src/clone.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ pub macro Clone($item:item) {
216216
/// Use closures allow captured values to be automatically used.
217217
/// This is similar to have a closure that you would call `.use` over each captured value.
218218
#[unstable(feature = "ergonomic_clones", issue = "132290")]
219-
#[cfg_attr(not(bootstrap), lang = "use_cloned")]
219+
#[lang = "use_cloned"]
220220
pub trait UseCloned: Clone {
221221
// Empty.
222222
}

Diff for: core/src/fmt/mod.rs

-28
Original file line numberDiff line numberDiff line change
@@ -1515,19 +1515,6 @@ unsafe fn run(fmt: &mut Formatter<'_>, arg: &rt::Placeholder, args: &[rt::Argume
15151515
// which guarantees the indexes are always within bounds.
15161516
unsafe { (getcount(args, &arg.width), getcount(args, &arg.precision)) };
15171517

1518-
#[cfg(bootstrap)]
1519-
let options =
1520-
*FormattingOptions { flags: flags::ALWAYS_SET | arg.flags << 21, width: 0, precision: 0 }
1521-
.align(match arg.align {
1522-
rt::Alignment::Left => Some(Alignment::Left),
1523-
rt::Alignment::Right => Some(Alignment::Right),
1524-
rt::Alignment::Center => Some(Alignment::Center),
1525-
rt::Alignment::Unknown => None,
1526-
})
1527-
.fill(arg.fill)
1528-
.width(width)
1529-
.precision(precision);
1530-
#[cfg(not(bootstrap))]
15311518
let options = FormattingOptions { flags: arg.flags, width, precision };
15321519

15331520
// Extract the correct argument
@@ -1544,21 +1531,6 @@ unsafe fn run(fmt: &mut Formatter<'_>, arg: &rt::Placeholder, args: &[rt::Argume
15441531
unsafe { value.fmt(fmt) }
15451532
}
15461533

1547-
#[cfg(bootstrap)]
1548-
unsafe fn getcount(args: &[rt::Argument<'_>], cnt: &rt::Count) -> Option<u16> {
1549-
match *cnt {
1550-
rt::Count::Is(n) => Some(n as u16),
1551-
rt::Count::Implied => None,
1552-
rt::Count::Param(i) => {
1553-
debug_assert!(i < args.len());
1554-
// SAFETY: cnt and args come from the same Arguments,
1555-
// which guarantees this index is always within bounds.
1556-
unsafe { args.get_unchecked(i).as_u16() }
1557-
}
1558-
}
1559-
}
1560-
1561-
#[cfg(not(bootstrap))]
15621534
unsafe fn getcount(args: &[rt::Argument<'_>], cnt: &rt::Count) -> u16 {
15631535
match *cnt {
15641536
rt::Count::Is(n) => n,

Diff for: core/src/fmt/rt.rs

+2-27
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ use crate::ptr::NonNull;
1111
#[derive(Copy, Clone)]
1212
pub struct Placeholder {
1313
pub position: usize,
14-
#[cfg(bootstrap)]
15-
pub fill: char,
16-
#[cfg(bootstrap)]
17-
pub align: Alignment,
1814
pub flags: u32,
1915
pub precision: Count,
2016
pub width: Count,
@@ -23,38 +19,17 @@ pub struct Placeholder {
2319
#[cfg(bootstrap)]
2420
impl Placeholder {
2521
#[inline]
26-
pub const fn new(
27-
position: usize,
28-
fill: char,
29-
align: Alignment,
30-
flags: u32,
31-
precision: Count,
32-
width: Count,
33-
) -> Self {
34-
Self { position, fill, align, flags, precision, width }
22+
pub const fn new(position: usize, flags: u32, precision: Count, width: Count) -> Self {
23+
Self { position, flags, precision, width }
3524
}
3625
}
3726

38-
#[cfg(bootstrap)]
39-
#[lang = "format_alignment"]
40-
#[derive(Copy, Clone, PartialEq, Eq)]
41-
pub enum Alignment {
42-
Left,
43-
Right,
44-
Center,
45-
Unknown,
46-
}
47-
4827
/// Used by [width](https://doc.rust-lang.org/std/fmt/#width)
4928
/// and [precision](https://doc.rust-lang.org/std/fmt/#precision) specifiers.
5029
#[lang = "format_count"]
5130
#[derive(Copy, Clone)]
5231
pub enum Count {
5332
/// Specified with a literal number, stores the value
54-
#[cfg(bootstrap)]
55-
Is(usize),
56-
/// Specified with a literal number, stores the value
57-
#[cfg(not(bootstrap))]
5833
Is(u16),
5934
/// Specified using `$` and `*` syntaxes, stores the index into `args`
6035
Param(usize),

Diff for: core/src/intrinsics/mod.rs

-48
Original file line numberDiff line numberDiff line change
@@ -2304,41 +2304,17 @@ pub unsafe fn truncf128(x: f128) -> f128;
23042304
/// [`f16::round_ties_even`](../../std/primitive.f16.html#method.round_ties_even)
23052305
#[rustc_intrinsic]
23062306
#[rustc_nounwind]
2307-
#[cfg(not(bootstrap))]
23082307
pub fn round_ties_even_f16(x: f16) -> f16;
23092308

2310-
/// To be removed on next bootstrap bump.
2311-
#[cfg(bootstrap)]
2312-
pub fn round_ties_even_f16(x: f16) -> f16 {
2313-
#[rustc_intrinsic]
2314-
#[rustc_nounwind]
2315-
unsafe fn rintf16(x: f16) -> f16;
2316-
2317-
// SAFETY: this intrinsic isn't actually unsafe
2318-
unsafe { rintf16(x) }
2319-
}
2320-
23212309
/// Returns the nearest integer to an `f32`. Rounds half-way cases to the number with an even
23222310
/// least significant digit.
23232311
///
23242312
/// The stabilized version of this intrinsic is
23252313
/// [`f32::round_ties_even`](../../std/primitive.f32.html#method.round_ties_even)
23262314
#[rustc_intrinsic]
23272315
#[rustc_nounwind]
2328-
#[cfg(not(bootstrap))]
23292316
pub fn round_ties_even_f32(x: f32) -> f32;
23302317

2331-
/// To be removed on next bootstrap bump.
2332-
#[cfg(bootstrap)]
2333-
pub fn round_ties_even_f32(x: f32) -> f32 {
2334-
#[rustc_intrinsic]
2335-
#[rustc_nounwind]
2336-
unsafe fn rintf32(x: f32) -> f32;
2337-
2338-
// SAFETY: this intrinsic isn't actually unsafe
2339-
unsafe { rintf32(x) }
2340-
}
2341-
23422318
/// Provided for compatibility with stdarch. DO NOT USE.
23432319
#[inline(always)]
23442320
pub unsafe fn rintf32(x: f32) -> f32 {
@@ -2352,20 +2328,8 @@ pub unsafe fn rintf32(x: f32) -> f32 {
23522328
/// [`f64::round_ties_even`](../../std/primitive.f64.html#method.round_ties_even)
23532329
#[rustc_intrinsic]
23542330
#[rustc_nounwind]
2355-
#[cfg(not(bootstrap))]
23562331
pub fn round_ties_even_f64(x: f64) -> f64;
23572332

2358-
/// To be removed on next bootstrap bump.
2359-
#[cfg(bootstrap)]
2360-
pub fn round_ties_even_f64(x: f64) -> f64 {
2361-
#[rustc_intrinsic]
2362-
#[rustc_nounwind]
2363-
unsafe fn rintf64(x: f64) -> f64;
2364-
2365-
// SAFETY: this intrinsic isn't actually unsafe
2366-
unsafe { rintf64(x) }
2367-
}
2368-
23692333
/// Provided for compatibility with stdarch. DO NOT USE.
23702334
#[inline(always)]
23712335
pub unsafe fn rintf64(x: f64) -> f64 {
@@ -2379,20 +2343,8 @@ pub unsafe fn rintf64(x: f64) -> f64 {
23792343
/// [`f128::round_ties_even`](../../std/primitive.f128.html#method.round_ties_even)
23802344
#[rustc_intrinsic]
23812345
#[rustc_nounwind]
2382-
#[cfg(not(bootstrap))]
23832346
pub fn round_ties_even_f128(x: f128) -> f128;
23842347

2385-
/// To be removed on next bootstrap bump.
2386-
#[cfg(bootstrap)]
2387-
pub fn round_ties_even_f128(x: f128) -> f128 {
2388-
#[rustc_intrinsic]
2389-
#[rustc_nounwind]
2390-
unsafe fn rintf128(x: f128) -> f128;
2391-
2392-
// SAFETY: this intrinsic isn't actually unsafe
2393-
unsafe { rintf128(x) }
2394-
}
2395-
23962348
/// Returns the nearest integer to an `f16`. Rounds half-way cases away from zero.
23972349
///
23982350
/// The stabilized version of this intrinsic is

Diff for: core/src/macros/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1753,7 +1753,6 @@ pub(crate) mod builtin {
17531753
reason = "`type_alias_impl_trait` has open design concerns"
17541754
)]
17551755
#[rustc_builtin_macro]
1756-
#[cfg(not(bootstrap))]
17571756
pub macro define_opaque($($tt:tt)*) {
17581757
/* compiler built-in */
17591758
}

Diff for: core/src/pat.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ macro_rules! pattern_type {
2525
)]
2626
pub trait RangePattern {
2727
/// Trait version of the inherent `MIN` assoc const.
28-
#[cfg_attr(not(bootstrap), lang = "RangeMin")]
28+
#[lang = "RangeMin"]
2929
const MIN: Self;
3030

3131
/// Trait version of the inherent `MIN` assoc const.
32-
#[cfg_attr(not(bootstrap), lang = "RangeMax")]
32+
#[lang = "RangeMax"]
3333
const MAX: Self;
3434

3535
/// A compile-time helper to subtract 1 for exclusive ranges.
36-
#[cfg_attr(not(bootstrap), lang = "RangeSub")]
36+
#[lang = "RangeSub"]
3737
#[track_caller]
3838
fn sub_one(self) -> Self;
3939
}

Diff for: core/src/pin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1943,7 +1943,7 @@ unsafe impl<T: ?Sized> PinCoerceUnsized for *mut T {}
19431943
#[stable(feature = "pin_macro", since = "1.68.0")]
19441944
#[rustc_macro_transparency = "semitransparent"]
19451945
#[allow_internal_unstable(unsafe_pin_internals)]
1946-
#[cfg_attr(not(bootstrap), rustc_macro_edition_2021)]
1946+
#[rustc_macro_edition_2021]
19471947
pub macro pin($value:expr $(,)?) {
19481948
// This is `Pin::new_unchecked(&mut { $value })`, so, for starters, let's
19491949
// review such a hypothetical macro (that any user-code could define):

Diff for: core/src/prelude/v1.rs

-1
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,4 @@ pub use crate::macros::builtin::deref;
117117
issue = "63063",
118118
reason = "`type_alias_impl_trait` has open design concerns"
119119
)]
120-
#[cfg(not(bootstrap))]
121120
pub use crate::macros::builtin::define_opaque;

Diff for: coretests/tests/pin_macro.rs

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ fn rust_2024_expr() {
3838
}
3939

4040
#[test]
41-
#[cfg(not(bootstrap))]
4241
fn temp_lifetime() {
4342
// Check that temporary lifetimes work as in Rust 2021.
4443
// Regression test for https://github.com/rust-lang/rust/issues/138596

Diff for: panic_unwind/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ cfg_if::cfg_if! {
7979
unsafe extern "C" {
8080
/// Handler in std called when a panic object is dropped outside of
8181
/// `catch_unwind`.
82-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
82+
#[rustc_std_internal_symbol]
8383
fn __rust_drop_panic() -> !;
8484

8585
/// Handler in std called when a foreign exception is caught.
86-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
86+
#[rustc_std_internal_symbol]
8787
fn __rust_foreign_exception() -> !;
8888
}
8989

Diff for: proc_macro/src/bridge/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#![deny(unsafe_code)]
1010
// proc_macros anyway don't work on wasm hosts so while both sides of this bridge can
1111
// be built with different versions of rustc, the wasm ABI changes don't really matter.
12-
#![cfg_attr(bootstrap, allow(unknown_lints))]
1312
#![allow(wasm_c_abi)]
1413

1514
use std::hash::Hash;

Diff for: std/src/alloc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ fn default_alloc_error_hook(layout: Layout) {
348348
unsafe extern "Rust" {
349349
// This symbol is emitted by rustc next to __rust_alloc_error_handler.
350350
// Its value depends on the -Zoom={panic,abort} compiler option.
351-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
351+
#[rustc_std_internal_symbol]
352352
static __rust_alloc_error_handler_should_panic: u8;
353353
}
354354

Diff for: std/src/backtrace.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ mod helper {
432432
use super::*;
433433
pub(super) type LazyResolve = impl (FnOnce() -> Capture) + Send + Sync + UnwindSafe;
434434

435-
#[cfg_attr(not(bootstrap), define_opaque(LazyResolve))]
435+
#[define_opaque(LazyResolve)]
436436
pub(super) fn lazy_resolve(mut capture: Capture) -> LazyResolve {
437437
move || {
438438
// Use the global backtrace lock to synchronize this as it's a

Diff for: std/src/panicking.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ pub static EMPTY_PANIC: fn(&'static str) -> ! =
5555
// hook up these functions, but it is not this day!
5656
#[allow(improper_ctypes)]
5757
unsafe extern "C" {
58-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
58+
#[rustc_std_internal_symbol]
5959
fn __rust_panic_cleanup(payload: *mut u8) -> *mut (dyn Any + Send + 'static);
6060
}
6161

6262
unsafe extern "Rust" {
6363
/// `PanicPayload` lazily performs allocation only when needed (this avoids
6464
/// allocations when using the "abort" panic runtime).
65-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
65+
#[rustc_std_internal_symbol]
6666
fn __rust_start_panic(payload: &mut dyn PanicPayload) -> u32;
6767
}
6868

Diff for: std/src/prelude/v1.rs

-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ pub use core::prelude::v1::deref;
109109
issue = "63063",
110110
reason = "`type_alias_impl_trait` has open design concerns"
111111
)]
112-
#[cfg(not(bootstrap))]
113112
pub use core::prelude::v1::define_opaque;
114113

115114
// The file so far is equivalent to core/src/prelude/v1.rs. It is duplicated

0 commit comments

Comments
 (0)