Skip to content

Commit 68a965e

Browse files
Step all bootstrap cfgs forward
1 parent 11886ad commit 68a965e

File tree

25 files changed

+27
-160
lines changed

25 files changed

+27
-160
lines changed

Diff for: compiler/rustc_index_macros/src/lib.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@ mod newtype;
3131
/// - `#[max = 0xFFFF_FFFD]`: specifies the max value, which allows niche
3232
/// optimizations. The default max value is 0xFFFF_FF00.
3333
/// - `#[gate_rustc_only]`: makes parts of the generated code nightly-only.
34-
///
35-
/// `SpecOptionPartialEq` is specialized by this macro, so using it requires enabling
36-
/// `#![feature(min_specialization)]` for the crate.
3734
#[proc_macro]
3835
#[cfg_attr(
3936
feature = "nightly",
40-
allow_internal_unstable(step_trait, rustc_attrs, trusted_step, spec_option_partial_eq)
37+
allow_internal_unstable(
38+
step_trait,
39+
rustc_attrs,
40+
trusted_step,
41+
spec_option_partial_eq,
42+
min_specialization
43+
)
4144
)]
42-
// FIXME: Remove the above comment about `min_specialization` once bootstrap is bumped,
43-
// and the corresponding one on SpecOptionPartialEq
44-
#[cfg_attr(all(feature = "nightly", not(bootstrap)), allow_internal_unstable(min_specialization))]
4545
pub fn newtype_index(input: TokenStream) -> TokenStream {
4646
newtype::newtype(input)
4747
}

Diff for: compiler/rustc_lint/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#![feature(if_let_guard)]
3535
#![feature(iter_order_by)]
3636
#![feature(let_chains)]
37-
#![cfg_attr(not(bootstrap), feature(trait_upcasting))]
37+
#![feature(trait_upcasting)]
3838
#![feature(min_specialization)]
3939
#![feature(rustc_attrs)]
4040
#![deny(rustc::untranslatable_diagnostic)]

Diff for: compiler/rustc_middle/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
#![feature(associated_type_bounds)]
4949
#![feature(rustc_attrs)]
5050
#![feature(control_flow_enum)]
51-
#![cfg_attr(not(bootstrap), feature(trait_upcasting))]
51+
#![feature(trait_upcasting)]
5252
#![feature(try_blocks)]
5353
#![feature(decl_macro)]
5454
#![feature(extract_if)]

Diff for: library/core/src/async_iter/async_iter.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub trait AsyncIterator {
4747
/// Rust's usual rules apply: calls must never cause undefined behavior
4848
/// (memory corruption, incorrect use of `unsafe` functions, or the like),
4949
/// regardless of the async iterator's state.
50-
#[cfg_attr(not(bootstrap), lang = "async_iterator_poll_next")]
50+
#[lang = "async_iterator_poll_next"]
5151
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>>;
5252

5353
/// Returns the bounds on the remaining length of the async iterator.
@@ -145,7 +145,7 @@ pub trait IntoAsyncIterator {
145145
type IntoAsyncIter: AsyncIterator<Item = Self::Item>;
146146

147147
/// Converts `self` into an async iterator
148-
#[cfg_attr(not(bootstrap), lang = "into_async_iter_into_iter")]
148+
#[lang = "into_async_iter_into_iter"]
149149
fn into_async_iter(self) -> Self::IntoAsyncIter;
150150
}
151151

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

-9
Original file line numberDiff line numberDiff line change
@@ -2567,18 +2567,9 @@ extern "rust-intrinsic" {
25672567
/// matter what*.
25682568
#[rustc_const_unstable(feature = "is_val_statically_known", issue = "none")]
25692569
#[rustc_nounwind]
2570-
#[cfg(not(bootstrap))]
25712570
pub fn is_val_statically_known<T: Copy>(arg: T) -> bool;
25722571
}
25732572

2574-
// FIXME: Seems using `unstable` here completely ignores `rustc_allow_const_fn_unstable`
2575-
// and thus compiling stage0 core doesn't work.
2576-
#[rustc_const_stable(feature = "is_val_statically_known", since = "0.0.0")]
2577-
#[cfg(bootstrap)]
2578-
pub const unsafe fn is_val_statically_known<T: Copy>(_arg: T) -> bool {
2579-
false
2580-
}
2581-
25822573
// Some functions are defined here because they accidentally got made
25832574
// available in this module on stable. See <https://github.com/rust-lang/rust/issues/15702>.
25842575
// (`transmute` also falls into this category, but it cannot be wrapped due to the

Diff for: library/core/src/intrinsics/mir.rs

-2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@
105105
//! }
106106
//!
107107
//! #[custom_mir(dialect = "runtime", phase = "optimized")]
108-
#![cfg_attr(bootstrap, doc = "#[cfg(any())]")] // disable the following function in doctests when `bootstrap` is set
109108
//! fn push_and_pop<T>(v: &mut Vec<T>, value: T) {
110109
//! mir!(
111110
//! let _unused;
@@ -357,7 +356,6 @@ define!("mir_unwind_resume",
357356

358357
define!("mir_storage_live", fn StorageLive<T>(local: T));
359358
define!("mir_storage_dead", fn StorageDead<T>(local: T));
360-
#[cfg(not(bootstrap))]
361359
define!("mir_assume", fn Assume(operand: bool));
362360
define!("mir_deinit", fn Deinit<T>(place: T));
363361
define!("mir_checked", fn Checked<T>(binop: T) -> (T, bool));

Diff for: library/core/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@
111111
//
112112
// Library features:
113113
// tidy-alphabetical-start
114-
#![cfg_attr(not(bootstrap), feature(offset_of_nested))]
115114
#![feature(char_indices_offset)]
116115
#![feature(const_align_of_val)]
117116
#![feature(const_align_of_val_raw)]
@@ -180,6 +179,7 @@
180179
#![feature(maybe_uninit_uninit_array)]
181180
#![feature(non_null_convenience)]
182181
#![feature(offset_of_enum)]
182+
#![feature(offset_of_nested)]
183183
#![feature(panic_internals)]
184184
#![feature(ptr_alignment_type)]
185185
#![feature(ptr_metadata)]

Diff for: library/core/src/marker.rs

-89
Original file line numberDiff line numberDiff line change
@@ -225,77 +225,6 @@ marker_impls! {
225225
{T: ?Sized} &T,
226226
}
227227

228-
/// Required trait for constants used in pattern matches.
229-
///
230-
/// Any type that derives `Eq` automatically implements this trait, *regardless*
231-
/// of whether its type parameters implement `Eq`.
232-
///
233-
/// This is a hack to work around a limitation in our type system.
234-
///
235-
/// # Background
236-
///
237-
/// We want to require that types of consts used in pattern matches
238-
/// have the attribute `#[derive(PartialEq, Eq)]`.
239-
///
240-
/// In a more ideal world, we could check that requirement by just checking that
241-
/// the given type implements both the `StructuralPartialEq` trait *and*
242-
/// the `Eq` trait. However, you can have ADTs that *do* `derive(PartialEq, Eq)`,
243-
/// and be a case that we want the compiler to accept, and yet the constant's
244-
/// type fails to implement `Eq`.
245-
///
246-
/// Namely, a case like this:
247-
///
248-
/// ```rust
249-
/// #[derive(PartialEq, Eq)]
250-
/// struct Wrap<X>(X);
251-
///
252-
/// fn higher_order(_: &()) { }
253-
///
254-
/// const CFN: Wrap<fn(&())> = Wrap(higher_order);
255-
///
256-
/// #[allow(pointer_structural_match)]
257-
/// fn main() {
258-
/// match CFN {
259-
/// CFN => {}
260-
/// _ => {}
261-
/// }
262-
/// }
263-
/// ```
264-
///
265-
/// (The problem in the above code is that `Wrap<fn(&())>` does not implement
266-
/// `PartialEq`, nor `Eq`, because `for<'a> fn(&'a _)` does not implement those
267-
/// traits.)
268-
///
269-
/// Therefore, we cannot rely on naive check for `StructuralPartialEq` and
270-
/// mere `Eq`.
271-
///
272-
/// As a hack to work around this, we use two separate traits injected by each
273-
/// of the two derives (`#[derive(PartialEq)]` and `#[derive(Eq)]`) and check
274-
/// that both of them are present as part of structural-match checking.
275-
#[unstable(feature = "structural_match", issue = "31434")]
276-
#[diagnostic::on_unimplemented(message = "the type `{Self}` does not `#[derive(Eq)]`")]
277-
#[lang = "structural_teq"]
278-
#[cfg(bootstrap)]
279-
pub trait StructuralEq {
280-
// Empty.
281-
}
282-
283-
// FIXME: Remove special cases of these types from the compiler pattern checking code and always check `T: StructuralEq` instead
284-
marker_impls! {
285-
#[unstable(feature = "structural_match", issue = "31434")]
286-
#[cfg(bootstrap)]
287-
StructuralEq for
288-
usize, u8, u16, u32, u64, u128,
289-
isize, i8, i16, i32, i64, i128,
290-
bool,
291-
char,
292-
str /* Technically requires `[u8]: StructuralEq` */,
293-
(),
294-
{T, const N: usize} [T; N],
295-
{T} [T],
296-
{T: ?Sized} &T,
297-
}
298-
299228
/// Types whose values can be duplicated simply by copying bits.
300229
///
301230
/// By default, variable bindings have 'move semantics.' In other
@@ -860,10 +789,6 @@ impl<T: ?Sized> Default for PhantomData<T> {
860789
#[unstable(feature = "structural_match", issue = "31434")]
861790
impl<T: ?Sized> StructuralPartialEq for PhantomData<T> {}
862791

863-
#[unstable(feature = "structural_match", issue = "31434")]
864-
#[cfg(bootstrap)]
865-
impl<T: ?Sized> StructuralEq for PhantomData<T> {}
866-
867792
/// Compiler-internal trait used to indicate the type of enum discriminants.
868793
///
869794
/// This trait is automatically implemented for every type and does not add any
@@ -1041,22 +966,8 @@ pub trait PointerLike {}
1041966
#[unstable(feature = "adt_const_params", issue = "95174")]
1042967
#[diagnostic::on_unimplemented(message = "`{Self}` can't be used as a const parameter type")]
1043968
#[allow(multiple_supertrait_upcastable)]
1044-
#[cfg(not(bootstrap))]
1045969
pub trait ConstParamTy: StructuralPartialEq + Eq {}
1046970

1047-
/// A marker for types which can be used as types of `const` generic parameters.
1048-
///
1049-
/// These types must have a proper equivalence relation (`Eq`) and it must be automatically
1050-
/// derived (`StructuralPartialEq`). There's a hard-coded check in the compiler ensuring
1051-
/// that all fields are also `ConstParamTy`, which implies that recursively, all fields
1052-
/// are `StructuralPartialEq`.
1053-
#[lang = "const_param_ty"]
1054-
#[unstable(feature = "adt_const_params", issue = "95174")]
1055-
#[rustc_on_unimplemented(message = "`{Self}` can't be used as a const parameter type")]
1056-
#[allow(multiple_supertrait_upcastable)]
1057-
#[cfg(bootstrap)]
1058-
pub trait ConstParamTy: StructuralEq + StructuralPartialEq + Eq {}
1059-
1060971
/// Derive macro generating an impl of the trait `ConstParamTy`.
1061972
#[rustc_builtin_macro]
1062973
#[unstable(feature = "adt_const_params", issue = "95174")]

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

-10
Original file line numberDiff line numberDiff line change
@@ -1393,19 +1393,9 @@ impl<T> SizedTypeProperties for T {}
13931393
///
13941394
/// assert_eq!(mem::offset_of!(Option<&u8>, Some.0), 0);
13951395
/// ```
1396-
#[cfg(not(bootstrap))]
13971396
#[stable(feature = "offset_of", since = "1.77.0")]
13981397
#[allow_internal_unstable(builtin_syntax, hint_must_use)]
13991398
pub macro offset_of($Container:ty, $($fields:expr)+ $(,)?) {
14001399
// The `{}` is for better error messages
14011400
crate::hint::must_use({builtin # offset_of($Container, $($fields)+)})
14021401
}
1403-
1404-
#[cfg(bootstrap)]
1405-
#[stable(feature = "offset_of", since = "1.77.0")]
1406-
#[allow_internal_unstable(builtin_syntax, hint_must_use)]
1407-
#[allow(missing_docs)]
1408-
pub macro offset_of($Container:ty, $($fields:tt).+ $(,)?) {
1409-
// The `{}` is for better error messages
1410-
crate::hint::must_use({builtin # offset_of($Container, $($fields).+)})
1411-
}

Diff for: library/core/src/num/nonzero.rs

-6
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
use crate::cmp::Ordering;
44
use crate::fmt;
55
use crate::hash::{Hash, Hasher};
6-
#[cfg(bootstrap)]
7-
use crate::marker::StructuralEq;
86
use crate::marker::StructuralPartialEq;
97
use crate::ops::{BitOr, BitOrAssign, Div, Neg, Rem};
108
use crate::str::FromStr;
@@ -569,10 +567,6 @@ macro_rules! nonzero_integer {
569567
#[$stability]
570568
impl Eq for $Ty {}
571569

572-
#[unstable(feature = "structural_match", issue = "31434")]
573-
#[cfg(bootstrap)]
574-
impl StructuralEq for $Ty {}
575-
576570
#[$stability]
577571
impl PartialOrd for $Ty {
578572
#[inline]

Diff for: library/core/src/ops/async_function.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::marker::Tuple;
88
#[rustc_paren_sugar]
99
#[fundamental]
1010
#[must_use = "async closures are lazy and do nothing unless called"]
11-
#[cfg_attr(not(bootstrap), lang = "async_fn")]
11+
#[lang = "async_fn"]
1212
pub trait AsyncFn<Args: Tuple>: AsyncFnMut<Args> {
1313
/// Future returned by [`AsyncFn::async_call`].
1414
#[unstable(feature = "async_fn_traits", issue = "none")]
@@ -28,7 +28,7 @@ pub trait AsyncFn<Args: Tuple>: AsyncFnMut<Args> {
2828
#[rustc_paren_sugar]
2929
#[fundamental]
3030
#[must_use = "async closures are lazy and do nothing unless called"]
31-
#[cfg_attr(not(bootstrap), lang = "async_fn_mut")]
31+
#[lang = "async_fn_mut"]
3232
pub trait AsyncFnMut<Args: Tuple>: AsyncFnOnce<Args> {
3333
/// Future returned by [`AsyncFnMut::async_call_mut`].
3434
#[unstable(feature = "async_fn_traits", issue = "none")]
@@ -48,7 +48,7 @@ pub trait AsyncFnMut<Args: Tuple>: AsyncFnOnce<Args> {
4848
#[rustc_paren_sugar]
4949
#[fundamental]
5050
#[must_use = "async closures are lazy and do nothing unless called"]
51-
#[cfg_attr(not(bootstrap), lang = "async_fn_once")]
51+
#[lang = "async_fn_once"]
5252
pub trait AsyncFnOnce<Args: Tuple> {
5353
/// Future returned by [`AsyncFnOnce::async_call_once`].
5454
#[unstable(feature = "async_fn_traits", issue = "none")]

Diff for: library/core/src/ops/coroutine.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ pub trait Coroutine<R = ()> {
111111
/// been returned previously. While coroutine literals in the language are
112112
/// guaranteed to panic on resuming after `Complete`, this is not guaranteed
113113
/// for all implementations of the `Coroutine` trait.
114-
#[cfg_attr(not(bootstrap), lang = "coroutine_resume")]
114+
#[lang = "coroutine_resume"]
115115
fn resume(self: Pin<&mut Self>, arg: R) -> CoroutineState<Self::Yield, Self::Return>;
116116
}
117117

Diff for: library/core/src/option.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2155,7 +2155,6 @@ impl<T: PartialEq> PartialEq for Option<T> {
21552155
///
21562156
/// Once that's fixed, `Option` should go back to deriving `PartialEq`, as
21572157
/// it used to do before <https://github.com/rust-lang/rust/pull/103556>.
2158-
/// The comment regarding this trait on the `newtype_index` macro should be removed if this is done.
21592158
#[unstable(feature = "spec_option_partial_eq", issue = "none", reason = "exposed only for rustc")]
21602159
#[doc(hidden)]
21612160
pub trait SpecOptionPartialEq: Sized {

Diff for: library/core/src/slice/mod.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1951,10 +1951,7 @@ impl<T> [T] {
19511951
/// }
19521952
/// ```
19531953
#[unstable(feature = "slice_split_at_unchecked", reason = "new API", issue = "76014")]
1954-
#[rustc_const_stable(
1955-
feature = "const_slice_split_at_unchecked",
1956-
since = "1.77.0"
1957-
)]
1954+
#[rustc_const_stable(feature = "const_slice_split_at_unchecked", since = "1.77.0")]
19581955
#[inline]
19591956
#[must_use]
19601957
pub const unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T]) {

Diff for: library/core/src/tuple.rs

-8
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,6 @@ macro_rules! tuple_impls {
6161
{}
6262
}
6363

64-
maybe_tuple_doc! {
65-
$($T)+ @
66-
#[unstable(feature = "structural_match", issue = "31434")]
67-
#[cfg(bootstrap)]
68-
impl<$($T),+> crate::marker::StructuralEq for ($($T,)+)
69-
{}
70-
}
71-
7264
maybe_tuple_doc! {
7365
$($T)+ @
7466
#[stable(feature = "rust1", since = "1.0.0")]

Diff for: library/core/tests/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
#![feature(noop_waker)]
5959
#![feature(numfmt)]
6060
#![feature(num_midpoint)]
61-
#![cfg_attr(not(bootstrap), feature(offset_of_nested))]
61+
#![feature(offset_of_nested)]
6262
#![feature(isqrt)]
6363
#![feature(step_trait)]
6464
#![feature(str_internals)]
@@ -111,7 +111,7 @@
111111
#![feature(slice_flatten)]
112112
#![feature(error_generic_member_access)]
113113
#![feature(error_in_core)]
114-
#![cfg_attr(not(bootstrap), feature(trait_upcasting))]
114+
#![feature(trait_upcasting)]
115115
#![feature(utf8_chunks)]
116116
#![feature(is_ascii_octdigit)]
117117
#![feature(get_many_mut)]

Diff for: library/panic_unwind/src/seh.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ cfg_if::cfg_if! {
262262
}
263263

264264
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint
265-
#[cfg_attr(not(bootstrap), allow(static_mut_ref))]
265+
#[allow(static_mut_ref)]
266266
pub unsafe fn panic(data: Box<dyn Any + Send>) -> u32 {
267267
use core::intrinsics::atomic_store_seqcst;
268268

@@ -325,7 +325,7 @@ pub unsafe fn panic(data: Box<dyn Any + Send>) -> u32 {
325325
}
326326

327327
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint
328-
#[cfg_attr(not(bootstrap), allow(static_mut_ref))]
328+
#[allow(static_mut_ref)]
329329
pub unsafe fn cleanup(payload: *mut u8) -> Box<dyn Any + Send> {
330330
// A null payload here means that we got here from the catch (...) of
331331
// __rust_try. This happens when a non-Rust foreign exception is caught.

Diff for: library/std/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,12 @@
265265
//
266266
// Language features:
267267
// tidy-alphabetical-start
268-
#![cfg_attr(not(bootstrap), feature(cfg_sanitizer_cfi))]
269268
#![feature(alloc_error_handler)]
270269
#![feature(allocator_internals)]
271270
#![feature(allow_internal_unsafe)]
272271
#![feature(allow_internal_unstable)]
273272
#![feature(c_unwind)]
273+
#![feature(cfg_sanitizer_cfi)]
274274
#![feature(cfg_target_thread_local)]
275275
#![feature(cfi_encoding)]
276276
#![feature(concat_idents)]

Diff for: library/std/src/panicking.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ pub mod panic_count {
338338
#[cfg(not(feature = "panic_immediate_abort"))]
339339
#[unstable(feature = "update_panic_count", issue = "none")]
340340
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint
341-
#[cfg_attr(not(bootstrap), allow(static_mut_ref))]
341+
#[allow(static_mut_ref)]
342342
pub mod panic_count {
343343
use crate::cell::Cell;
344344
use crate::sync::atomic::{AtomicUsize, Ordering};

0 commit comments

Comments
 (0)