Skip to content

Commit 4903268

Browse files
committed
update cfgs
1 parent 4149a00 commit 4903268

File tree

30 files changed

+30
-114
lines changed

30 files changed

+30
-114
lines changed

compiler/rustc_codegen_llvm/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
77
// tidy-alphabetical-start
88
#![allow(internal_features)]
9-
#![cfg_attr(bootstrap, feature(unsafe_extern_blocks))]
109
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
1110
#![doc(rust_logo)]
1211
#![feature(assert_matches)]

compiler/rustc_driver_impl/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
// tidy-alphabetical-start
88
#![allow(internal_features)]
99
#![allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
10-
#![cfg_attr(bootstrap, feature(unsafe_extern_blocks))]
1110
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
1211
#![doc(rust_logo)]
1312
#![feature(decl_macro)]

compiler/rustc_llvm/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// tidy-alphabetical-start
22
#![allow(internal_features)]
3-
#![cfg_attr(bootstrap, feature(unsafe_attributes, unsafe_extern_blocks))]
43
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
54
#![doc(rust_logo)]
65
#![feature(rustdoc_internals)]

compiler/rustc_middle/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#![allow(rustc::diagnostic_outside_of_impl)]
2929
#![allow(rustc::potential_query_instability)]
3030
#![allow(rustc::untranslatable_diagnostic)]
31-
#![cfg_attr(bootstrap, feature(min_exhaustive_patterns, unsafe_extern_blocks))]
3231
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
3332
#![doc(rust_logo)]
3433
#![feature(allocator_api)]

compiler/rustc_next_trait_solver/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//! So if you got to this crate from the old solver, it's totally normal.
66
77
// tidy-alphabetical-start
8-
#![cfg_attr(not(bootstrap), allow(rustc::usage_of_type_ir_inherent))]
8+
#![allow(rustc::usage_of_type_ir_inherent)]
99
#![warn(unreachable_pub)]
1010
// tidy-alphabetical-end
1111

compiler/rustc_target/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
1010
// tidy-alphabetical-start
1111
#![allow(internal_features)]
12-
#![cfg_attr(bootstrap, feature(min_exhaustive_patterns))]
1312
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
1413
#![doc(rust_logo)]
1514
#![feature(assert_matches)]

compiler/rustc_transmute/src/layout/nfa.rs

-2
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ where
8787
pub(crate) fn from_tree(tree: Tree<!, R>) -> Result<Self, Uninhabited> {
8888
Ok(match tree {
8989
Tree::Byte(b) => Self::from_byte(b),
90-
#[cfg(bootstrap)]
91-
Tree::Def(..) => unreachable!(),
9290
Tree::Ref(r) => Self::from_ref(r),
9391
Tree::Alt(alts) => {
9492
let mut alts = alts.into_iter().map(Self::from_tree);

compiler/rustc_type_ir/src/fold.rs

-4
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ pub trait TypeFoldable<I: Interner>: TypeVisitable<I> {
9191
fn fold_with<F: TypeFolder<I>>(self, folder: &mut F) -> Self {
9292
match self.try_fold_with(folder) {
9393
Ok(t) => t,
94-
#[cfg(bootstrap)]
95-
Err(e) => match e {},
9694
}
9795
}
9896
}
@@ -116,8 +114,6 @@ pub trait TypeSuperFoldable<I: Interner>: TypeFoldable<I> {
116114
fn super_fold_with<F: TypeFolder<I>>(self, folder: &mut F) -> Self {
117115
match self.try_super_fold_with(folder) {
118116
Ok(t) => t,
119-
#[cfg(bootstrap)]
120-
Err(e) => match e {},
121117
}
122118
}
123119
}

compiler/rustc_type_ir/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
feature(associated_type_defaults, never_type, rustc_attrs, negative_impls)
66
)]
77
#![cfg_attr(feature = "nightly", allow(internal_features))]
8-
#![cfg_attr(not(bootstrap), allow(rustc::usage_of_type_ir_inherent))]
8+
#![allow(rustc::usage_of_type_ir_inherent)]
99
#![warn(unreachable_pub)]
1010
// tidy-alphabetical-end
1111

library/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
}

library/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

library/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
}

library/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`.

library/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
///

library/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
///

library/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)]

library/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")]

library/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
}

library/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>,

library/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;

library/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
///

library/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:

library/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

library/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)]

0 commit comments

Comments
 (0)