Skip to content

Commit 349f8d5

Browse files
committed
update cfgs
1 parent 9ed92df commit 349f8d5

File tree

19 files changed

+28
-91
lines changed

19 files changed

+28
-91
lines changed

Diff for: alloc/src/collections/vec_deque/into_iter.rs

-4
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ impl<T, A: Allocator> Iterator for IntoIter<T, A> {
121121
{
122122
match self.try_fold(init, |b, item| Ok::<B, !>(f(b, item))) {
123123
Ok(b) => b,
124-
#[cfg(bootstrap)]
125-
Err(e) => match e {},
126124
}
127125
}
128126

@@ -243,8 +241,6 @@ impl<T, A: Allocator> DoubleEndedIterator for IntoIter<T, A> {
243241
{
244242
match self.try_rfold(init, |b, item| Ok::<B, !>(f(b, item))) {
245243
Ok(b) => b,
246-
#[cfg(bootstrap)]
247-
Err(e) => match e {},
248244
}
249245
}
250246
}

Diff for: core/src/arch.rs

-9
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,6 @@
44
#[stable(feature = "simd_arch", since = "1.27.0")]
55
pub use crate::core_arch::arch::*;
66

7-
#[cfg(bootstrap)]
8-
#[allow(dead_code)]
9-
#[unstable(feature = "sha512_sm_x86", issue = "126624")]
10-
fn dummy() {
11-
// AArch64 also has a target feature named `sm4`, so we need `#![feature(sha512_sm_x86)]` in lib.rs
12-
// But as the bootstrap compiler doesn't know about this feature yet, we need to convert it to a
13-
// library feature until bootstrap gets bumped
14-
}
15-
167
/// Inline assembly.
178
///
189
/// Refer to [Rust By Example] for a usage guide and the [reference] for

Diff for: core/src/cell.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ pub use once::OnceCell;
306306
/// See the [module-level documentation](self) for more.
307307
#[stable(feature = "rust1", since = "1.0.0")]
308308
#[repr(transparent)]
309-
#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
309+
#[rustc_pub_transparent]
310310
pub struct Cell<T: ?Sized> {
311311
value: UnsafeCell<T>,
312312
}
@@ -2056,7 +2056,7 @@ impl<T: ?Sized + fmt::Display> fmt::Display for RefMut<'_, T> {
20562056
#[lang = "unsafe_cell"]
20572057
#[stable(feature = "rust1", since = "1.0.0")]
20582058
#[repr(transparent)]
2059-
#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
2059+
#[rustc_pub_transparent]
20602060
pub struct UnsafeCell<T: ?Sized> {
20612061
value: T,
20622062
}
@@ -2299,7 +2299,7 @@ impl<T> UnsafeCell<*mut T> {
22992299
/// See [`UnsafeCell`] for details.
23002300
#[unstable(feature = "sync_unsafe_cell", issue = "95439")]
23012301
#[repr(transparent)]
2302-
#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
2302+
#[rustc_pub_transparent]
23032303
pub struct SyncUnsafeCell<T: ?Sized> {
23042304
value: UnsafeCell<T>,
23052305
}

Diff for: core/src/clone.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ pub trait Clone: Sized {
161161
#[must_use = "cloning is often expensive and is not expected to have side effects"]
162162
// Clone::clone is special because the compiler generates MIR to implement it for some types.
163163
// See InstanceKind::CloneShim.
164-
#[cfg_attr(not(bootstrap), lang = "clone_fn")]
164+
#[lang = "clone_fn"]
165165
fn clone(&self) -> Self;
166166

167167
/// Performs copy-assignment from `source`.

Diff for: core/src/default.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ use crate::ascii::Char as AsciiChar;
103103
/// ```
104104
#[cfg_attr(not(test), rustc_diagnostic_item = "Default")]
105105
#[stable(feature = "rust1", since = "1.0.0")]
106-
#[cfg_attr(not(bootstrap), rustc_trivial_field_reads)]
106+
#[rustc_trivial_field_reads]
107107
pub trait Default: Sized {
108108
/// Returns the "default value" for a type.
109109
///

Diff for: core/src/intrinsics.rs

-7
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,6 @@ pub const fn unlikely(b: bool) -> bool {
10201020
/// any safety invariants.
10211021
///
10221022
/// This intrinsic does not have a stable counterpart.
1023-
#[cfg(not(bootstrap))]
10241023
#[unstable(feature = "core_intrinsics", issue = "none")]
10251024
#[rustc_intrinsic]
10261025
#[rustc_nounwind]
@@ -1030,12 +1029,6 @@ pub fn select_unpredictable<T>(b: bool, true_val: T, false_val: T) -> T {
10301029
if b { true_val } else { false_val }
10311030
}
10321031

1033-
#[cfg(bootstrap)]
1034-
#[inline]
1035-
pub fn select_unpredictable<T>(b: bool, true_val: T, false_val: T) -> T {
1036-
if b { true_val } else { false_val }
1037-
}
1038-
10391032
extern "rust-intrinsic" {
10401033
/// Executes a breakpoint trap, for inspection by a debugger.
10411034
///

Diff for: core/src/lib.rs

-4
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@
107107
//
108108
// Library features:
109109
// tidy-alphabetical-start
110-
#![cfg_attr(bootstrap, feature(offset_of_nested))]
111110
#![feature(array_ptr_get)]
112111
#![feature(asm_experimental_arch)]
113112
#![feature(const_align_of_val)]
@@ -192,9 +191,6 @@
192191
//
193192
// Language features:
194193
// tidy-alphabetical-start
195-
#![cfg_attr(bootstrap, feature(asm_const))]
196-
#![cfg_attr(bootstrap, feature(const_fn_floating_point_arithmetic))]
197-
#![cfg_attr(bootstrap, feature(min_exhaustive_patterns))]
198194
#![feature(abi_unadjusted)]
199195
#![feature(adt_const_params)]
200196
#![feature(allow_internal_unsafe)]

Diff for: core/src/marker.rs

+4-13
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ pub macro ConstParamTy($item:item) {
992992
/* compiler built-in */
993993
}
994994

995-
#[cfg_attr(not(bootstrap), lang = "unsized_const_param_ty")]
995+
#[lang = "unsized_const_param_ty"]
996996
#[unstable(feature = "unsized_const_params", issue = "95174")]
997997
#[diagnostic::on_unimplemented(message = "`{Self}` can't be used as a const parameter type")]
998998
/// A marker for types which can be used as types of `const` generic parameters.
@@ -1002,10 +1002,9 @@ pub macro ConstParamTy($item:item) {
10021002
pub trait UnsizedConstParamTy: StructuralPartialEq + Eq {}
10031003

10041004
/// Derive macro generating an impl of the trait `ConstParamTy`.
1005-
#[cfg(not(bootstrap))]
1006-
#[cfg_attr(not(bootstrap), rustc_builtin_macro)]
1007-
#[cfg_attr(not(bootstrap), allow_internal_unstable(unsized_const_params))]
1008-
#[cfg_attr(not(bootstrap), unstable(feature = "unsized_const_params", issue = "95174"))]
1005+
#[rustc_builtin_macro]
1006+
#[allow_internal_unstable(unsized_const_params)]
1007+
#[unstable(feature = "unsized_const_params", issue = "95174")]
10091008
pub macro UnsizedConstParamTy($item:item) {
10101009
/* compiler built-in */
10111010
}
@@ -1021,14 +1020,6 @@ marker_impls! {
10211020
(),
10221021
{T: ConstParamTy_, const N: usize} [T; N],
10231022
}
1024-
#[cfg(bootstrap)]
1025-
marker_impls! {
1026-
#[unstable(feature = "adt_const_params", issue = "95174")]
1027-
ConstParamTy_ for
1028-
str,
1029-
{T: ConstParamTy_} [T],
1030-
{T: ConstParamTy_ + ?Sized} &T,
1031-
}
10321023

10331024
marker_impls! {
10341025
#[unstable(feature = "unsized_const_params", issue = "95174")]

Diff for: core/src/mem/manually_drop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ use crate::ptr;
4747
#[lang = "manually_drop"]
4848
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
4949
#[repr(transparent)]
50-
#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
50+
#[rustc_pub_transparent]
5151
pub struct ManuallyDrop<T: ?Sized> {
5252
value: T,
5353
}

Diff for: core/src/mem/maybe_uninit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ use crate::{fmt, intrinsics, ptr, slice};
237237
#[lang = "maybe_uninit"]
238238
#[derive(Copy)]
239239
#[repr(transparent)]
240-
#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
240+
#[rustc_pub_transparent]
241241
pub union MaybeUninit<T> {
242242
uninit: (),
243243
value: ManuallyDrop<T>,

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

-1
Original file line numberDiff line numberDiff line change
@@ -1326,7 +1326,6 @@ impl<T> SizedTypeProperties for T {}
13261326
/// # Examples
13271327
///
13281328
/// ```
1329-
/// # #![cfg_attr(bootstrap, feature(offset_of_nested))]
13301329
/// #![feature(offset_of_enum)]
13311330
///
13321331
/// use std::mem;

Diff for: core/src/mem/transmutability.rs

+10-19
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ use crate::marker::{ConstParamTy_, UnsizedConstParamTy};
4343
/// conversions that extend the bits of `Src` with trailing padding to fill
4444
/// trailing uninitialized bytes of `Self`; e.g.:
4545
///
46-
#[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
47-
#[cfg_attr(not(bootstrap), doc = "```rust")]
46+
/// ```rust
4847
/// #![feature(transmutability)]
4948
///
5049
/// use core::mem::{Assume, TransmuteFrom};
@@ -151,8 +150,7 @@ pub struct Assume {
151150
/// When `false`, [`TransmuteFrom`] is not implemented for transmutations
152151
/// that might violate the alignment requirements of references; e.g.:
153152
///
154-
#[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
155-
#[cfg_attr(not(bootstrap), doc = "```compile_fail,E0277")]
153+
/// ```compile_fail,E0277
156154
/// #![feature(transmutability)]
157155
/// use core::mem::{align_of, TransmuteFrom};
158156
///
@@ -171,8 +169,7 @@ pub struct Assume {
171169
/// that references in the transmuted value satisfy the alignment
172170
/// requirements of their referent types; e.g.:
173171
///
174-
#[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
175-
#[cfg_attr(not(bootstrap), doc = "```rust")]
172+
/// ```rust
176173
/// #![feature(pointer_is_aligned_to, transmutability)]
177174
/// use core::mem::{align_of, Assume, TransmuteFrom};
178175
///
@@ -203,8 +200,7 @@ pub struct Assume {
203200
/// that might violate the library safety invariants of the destination
204201
/// type; e.g.:
205202
///
206-
#[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
207-
#[cfg_attr(not(bootstrap), doc = "```compile_fail,E0277")]
203+
/// ```compile_fail,E0277
208204
/// #![feature(transmutability)]
209205
/// use core::mem::TransmuteFrom;
210206
///
@@ -225,8 +221,7 @@ pub struct Assume {
225221
/// that undefined behavior does not arise from using the transmuted value;
226222
/// e.g.:
227223
///
228-
#[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
229-
#[cfg_attr(not(bootstrap), doc = "```rust")]
224+
/// ```rust
230225
/// #![feature(transmutability)]
231226
/// use core::mem::{Assume, TransmuteFrom};
232227
///
@@ -254,8 +249,7 @@ pub struct Assume {
254249
/// that might violate the language-level bit-validity invariant of the
255250
/// destination type; e.g.:
256251
///
257-
#[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
258-
#[cfg_attr(not(bootstrap), doc = "```compile_fail,E0277")]
252+
/// ```compile_fail,E0277
259253
/// #![feature(transmutability)]
260254
/// use core::mem::TransmuteFrom;
261255
///
@@ -271,8 +265,7 @@ pub struct Assume {
271265
/// that the value being transmuted is a bit-valid instance of the
272266
/// transmuted value; e.g.:
273267
///
274-
#[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
275-
#[cfg_attr(not(bootstrap), doc = "```rust")]
268+
/// ```rust
276269
/// #![feature(transmutability)]
277270
/// use core::mem::{Assume, TransmuteFrom};
278271
///
@@ -335,9 +328,7 @@ impl Assume {
335328
/// This is especially useful for extending [`Assume`] in generic contexts;
336329
/// e.g.:
337330
///
338-
#[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
339-
#[cfg_attr(not(bootstrap), doc = "```rust")]
340-
#[unstable(feature = "transmutability", issue = "99571")]
331+
/// ```rust
341332
/// #![feature(
342333
/// adt_const_params,
343334
/// generic_const_exprs,
@@ -379,6 +370,7 @@ impl Assume {
379370
/// try_transmute_ref::<_, _, { Assume::NOTHING }>(src)
380371
/// };
381372
///```
373+
#[unstable(feature = "transmutability", issue = "99571")]
382374
pub const fn and(self, other_assumptions: Self) -> Self {
383375
Self {
384376
alignment: self.alignment || other_assumptions.alignment,
@@ -390,8 +382,7 @@ impl Assume {
390382

391383
/// Remove `other_assumptions` the obligations of `self`; e.g.:
392384
///
393-
#[cfg_attr(bootstrap, doc = "```rust,ignore not runnable on bootstrap")]
394-
#[cfg_attr(not(bootstrap), doc = "```rust")]
385+
/// ```rust
395386
/// #![feature(transmutability)]
396387
/// use core::mem::Assume;
397388
///

Diff for: core/src/pin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ use crate::{cmp, fmt};
10841084
#[lang = "pin"]
10851085
#[fundamental]
10861086
#[repr(transparent)]
1087-
#[cfg_attr(not(bootstrap), rustc_pub_transparent)]
1087+
#[rustc_pub_transparent]
10881088
#[derive(Copy, Clone)]
10891089
pub struct Pin<Ptr> {
10901090
// FIXME(#93176): this field is made `#[unstable] #[doc(hidden)] pub` to:

Diff for: core/src/tuple.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ macro_rules! tuple_impls {
154154
// Otherwise, it hides the docs entirely.
155155
macro_rules! maybe_tuple_doc {
156156
($a:ident @ #[$meta:meta] $item:item) => {
157-
#[cfg_attr(not(bootstrap), doc(fake_variadic))]
157+
#[doc(fake_variadic)]
158158
#[doc = "This trait is implemented for tuples up to twelve items long."]
159159
#[$meta]
160160
$item

Diff for: core/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// tidy-alphabetical-start
2-
#![cfg_attr(bootstrap, feature(offset_of_nested))]
32
#![cfg_attr(target_has_atomic = "128", feature(integer_atomics))]
43
#![cfg_attr(test, feature(cfg_match))]
54
#![feature(alloc_layout_extra)]

Diff for: panic_unwind/src/seh.rs

-6
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,6 @@ mod imp {
157157
// going to be cross-lang LTOed anyway. However, using expose is shorter and
158158
// requires less unsafe.
159159
let addr: usize = ptr.expose_provenance();
160-
#[cfg(bootstrap)]
161-
let image_base = unsafe { addr_of!(__ImageBase) }.addr();
162-
#[cfg(not(bootstrap))]
163160
let image_base = addr_of!(__ImageBase).addr();
164161
let offset: usize = addr - image_base;
165162
Self(offset as u32)
@@ -253,9 +250,6 @@ extern "C" {
253250
// This is fine since the MSVC runtime uses string comparison on the type name
254251
// to match TypeDescriptors rather than pointer equality.
255252
static mut TYPE_DESCRIPTOR: _TypeDescriptor = _TypeDescriptor {
256-
#[cfg(bootstrap)]
257-
pVFTable: unsafe { addr_of!(TYPE_INFO_VTABLE) } as *const _,
258-
#[cfg(not(bootstrap))]
259253
pVFTable: addr_of!(TYPE_INFO_VTABLE) as *const _,
260254
spare: core::ptr::null_mut(),
261255
name: TYPE_NAME,

Diff for: std/src/env.rs

+4-12
Original file line numberDiff line numberDiff line change
@@ -354,12 +354,8 @@ impl Error for VarError {
354354
/// }
355355
/// assert_eq!(env::var(key), Ok("VALUE".to_string()));
356356
/// ```
357-
#[cfg_attr(bootstrap, rustc_deprecated_safe_2024)]
358-
#[cfg_attr(
359-
not(bootstrap),
360-
rustc_deprecated_safe_2024(
361-
audit_that = "the environment access only happens in single-threaded code"
362-
)
357+
#[rustc_deprecated_safe_2024(
358+
audit_that = "the environment access only happens in single-threaded code"
363359
)]
364360
#[stable(feature = "env", since = "1.0.0")]
365361
pub unsafe fn set_var<K: AsRef<OsStr>, V: AsRef<OsStr>>(key: K, value: V) {
@@ -424,12 +420,8 @@ pub unsafe fn set_var<K: AsRef<OsStr>, V: AsRef<OsStr>>(key: K, value: V) {
424420
/// }
425421
/// assert!(env::var(key).is_err());
426422
/// ```
427-
#[cfg_attr(bootstrap, rustc_deprecated_safe_2024)]
428-
#[cfg_attr(
429-
not(bootstrap),
430-
rustc_deprecated_safe_2024(
431-
audit_that = "the environment access only happens in single-threaded code"
432-
)
423+
#[rustc_deprecated_safe_2024(
424+
audit_that = "the environment access only happens in single-threaded code"
433425
)]
434426
#[stable(feature = "env", since = "1.0.0")]
435427
pub unsafe fn remove_var<K: AsRef<OsStr>>(key: K) {

Diff for: std/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@
272272
//
273273
// Language features:
274274
// tidy-alphabetical-start
275-
#![cfg_attr(bootstrap, feature(min_exhaustive_patterns))]
276275
#![feature(alloc_error_handler)]
277276
#![feature(allocator_internals)]
278277
#![feature(allow_internal_unsafe)]

Diff for: std/src/os/unix/process.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,7 @@ pub trait CommandExt: Sealed {
118118
/// [`pre_exec`]: CommandExt::pre_exec
119119
#[stable(feature = "process_exec", since = "1.15.0")]
120120
#[deprecated(since = "1.37.0", note = "should be unsafe, use `pre_exec` instead")]
121-
#[cfg_attr(bootstrap, rustc_deprecated_safe_2024)]
122-
#[cfg_attr(
123-
not(bootstrap),
124-
rustc_deprecated_safe_2024(audit_that = "the closure is async-signal-safe")
125-
)]
121+
#[rustc_deprecated_safe_2024(audit_that = "the closure is async-signal-safe")]
126122
unsafe fn before_exec<F>(&mut self, f: F) -> &mut process::Command
127123
where
128124
F: FnMut() -> io::Result<()> + Send + Sync + 'static,

0 commit comments

Comments
 (0)