Skip to content

Commit 1119127

Browse files
pietroalbiniMark-Simulacrum
authored andcommitted
Update bootstrap cfg
1 parent 060a6ea commit 1119127

File tree

24 files changed

+38
-663
lines changed

24 files changed

+38
-663
lines changed

compiler/rustc_hir/src/hir.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3609,16 +3609,9 @@ mod size_asserts {
36093609
static_assert_size!(Res, 12);
36103610
static_assert_size!(Stmt<'_>, 32);
36113611
static_assert_size!(StmtKind<'_>, 16);
3612-
// tidy-alphabetical-end
3613-
// FIXME: move the tidy directive to the end after the next bootstrap bump
3614-
#[cfg(bootstrap)]
3615-
static_assert_size!(TraitItem<'_>, 88);
3616-
#[cfg(not(bootstrap))]
36173612
static_assert_size!(TraitItem<'_>, 80);
3618-
#[cfg(bootstrap)]
3619-
static_assert_size!(TraitItemKind<'_>, 48);
3620-
#[cfg(not(bootstrap))]
36213613
static_assert_size!(TraitItemKind<'_>, 40);
36223614
static_assert_size!(Ty<'_>, 48);
36233615
static_assert_size!(TyKind<'_>, 32);
3616+
// tidy-alphabetical-end
36243617
}

library/alloc/src/alloc.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -404,19 +404,6 @@ pub mod __alloc_error_handler {
404404
pub unsafe fn __rdl_oom(size: usize, _align: usize) -> ! {
405405
panic!("memory allocation of {size} bytes failed")
406406
}
407-
408-
#[cfg(bootstrap)]
409-
#[rustc_std_internal_symbol]
410-
pub unsafe fn __rg_oom(size: usize, align: usize) -> ! {
411-
use crate::alloc::Layout;
412-
413-
let layout = unsafe { Layout::from_size_align_unchecked(size, align) };
414-
extern "Rust" {
415-
#[lang = "oom"]
416-
fn oom_impl(layout: Layout) -> !;
417-
}
418-
unsafe { oom_impl(layout) }
419-
}
420407
}
421408

422409
/// Specialize clones into pre-allocated, uninitialized memory.

library/alloc/src/boxed.rs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ use core::hash::{Hash, Hasher};
158158
#[cfg(not(no_global_oom_handling))]
159159
use core::iter::FromIterator;
160160
use core::iter::{FusedIterator, Iterator};
161-
#[cfg(not(bootstrap))]
162161
use core::marker::Tuple;
163162
use core::marker::{Destruct, Unpin, Unsize};
164163
use core::mem;
@@ -1981,17 +1980,6 @@ impl<I: ExactSizeIterator + ?Sized, A: Allocator> ExactSizeIterator for Box<I, A
19811980
#[stable(feature = "fused", since = "1.26.0")]
19821981
impl<I: FusedIterator + ?Sized, A: Allocator> FusedIterator for Box<I, A> {}
19831982

1984-
#[cfg(bootstrap)]
1985-
#[stable(feature = "boxed_closure_impls", since = "1.35.0")]
1986-
impl<Args, F: FnOnce<Args> + ?Sized, A: Allocator> FnOnce<Args> for Box<F, A> {
1987-
type Output = <F as FnOnce<Args>>::Output;
1988-
1989-
extern "rust-call" fn call_once(self, args: Args) -> Self::Output {
1990-
<F as FnOnce<Args>>::call_once(*self, args)
1991-
}
1992-
}
1993-
1994-
#[cfg(not(bootstrap))]
19951983
#[stable(feature = "boxed_closure_impls", since = "1.35.0")]
19961984
impl<Args: Tuple, F: FnOnce<Args> + ?Sized, A: Allocator> FnOnce<Args> for Box<F, A> {
19971985
type Output = <F as FnOnce<Args>>::Output;
@@ -2001,31 +1989,13 @@ impl<Args: Tuple, F: FnOnce<Args> + ?Sized, A: Allocator> FnOnce<Args> for Box<F
20011989
}
20021990
}
20031991

2004-
#[cfg(bootstrap)]
2005-
#[stable(feature = "boxed_closure_impls", since = "1.35.0")]
2006-
impl<Args, F: FnMut<Args> + ?Sized, A: Allocator> FnMut<Args> for Box<F, A> {
2007-
extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output {
2008-
<F as FnMut<Args>>::call_mut(self, args)
2009-
}
2010-
}
2011-
2012-
#[cfg(not(bootstrap))]
20131992
#[stable(feature = "boxed_closure_impls", since = "1.35.0")]
20141993
impl<Args: Tuple, F: FnMut<Args> + ?Sized, A: Allocator> FnMut<Args> for Box<F, A> {
20151994
extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output {
20161995
<F as FnMut<Args>>::call_mut(self, args)
20171996
}
20181997
}
20191998

2020-
#[cfg(bootstrap)]
2021-
#[stable(feature = "boxed_closure_impls", since = "1.35.0")]
2022-
impl<Args, F: Fn<Args> + ?Sized, A: Allocator> Fn<Args> for Box<F, A> {
2023-
extern "rust-call" fn call(&self, args: Args) -> Self::Output {
2024-
<F as Fn<Args>>::call(self, args)
2025-
}
2026-
}
2027-
2028-
#[cfg(not(bootstrap))]
20291999
#[stable(feature = "boxed_closure_impls", since = "1.35.0")]
20302000
impl<Args: Tuple, F: Fn<Args> + ?Sized, A: Allocator> Fn<Args> for Box<F, A> {
20312001
extern "rust-call" fn call(&self, args: Args) -> Self::Output {

library/alloc/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
#![feature(trusted_len)]
154154
#![feature(trusted_random_access)]
155155
#![feature(try_trait_v2)]
156-
#![cfg_attr(not(bootstrap), feature(tuple_trait))]
156+
#![feature(tuple_trait)]
157157
#![feature(unchecked_math)]
158158
#![feature(unicode_internals)]
159159
#![feature(unsize)]

library/alloc/src/string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ use crate::vec::Vec;
363363
/// [`as_str()`]: String::as_str
364364
#[derive(PartialOrd, Eq, Ord)]
365365
#[stable(feature = "rust1", since = "1.0.0")]
366-
#[cfg_attr(all(not(bootstrap), not(test)), lang = "String")]
366+
#[cfg_attr(not(test), lang = "String")]
367367
pub struct String {
368368
vec: Vec<u8>,
369369
}

library/core/src/cmp.rs

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
use crate::const_closure::ConstFnMutClosure;
2626
use crate::marker::Destruct;
27-
#[cfg(bootstrap)]
28-
use crate::marker::StructuralPartialEq;
2927

3028
use self::Ordering::*;
3129

@@ -333,7 +331,7 @@ pub struct AssertParamIsEq<T: Eq + ?Sized> {
333331
/// assert_eq!(Ordering::Greater, result);
334332
/// ```
335333
#[derive(Clone, Copy, Eq, Debug, Hash)]
336-
#[cfg_attr(not(bootstrap), derive_const(PartialOrd, Ord, PartialEq))]
334+
#[derive_const(PartialOrd, Ord, PartialEq)]
337335
#[stable(feature = "rust1", since = "1.0.0")]
338336
#[repr(i8)]
339337
pub enum Ordering {
@@ -879,40 +877,6 @@ pub macro Ord($item:item) {
879877
/* compiler built-in */
880878
}
881879

882-
#[stable(feature = "rust1", since = "1.0.0")]
883-
#[cfg(bootstrap)]
884-
impl StructuralPartialEq for Ordering {}
885-
886-
#[stable(feature = "rust1", since = "1.0.0")]
887-
#[rustc_const_unstable(feature = "const_cmp", issue = "92391")]
888-
#[cfg(bootstrap)]
889-
impl const PartialEq for Ordering {
890-
#[inline]
891-
fn eq(&self, other: &Self) -> bool {
892-
(*self as i32).eq(&(*other as i32))
893-
}
894-
}
895-
896-
#[stable(feature = "rust1", since = "1.0.0")]
897-
#[rustc_const_unstable(feature = "const_cmp", issue = "92391")]
898-
#[cfg(bootstrap)]
899-
impl const Ord for Ordering {
900-
#[inline]
901-
fn cmp(&self, other: &Ordering) -> Ordering {
902-
(*self as i32).cmp(&(*other as i32))
903-
}
904-
}
905-
906-
#[stable(feature = "rust1", since = "1.0.0")]
907-
#[rustc_const_unstable(feature = "const_cmp", issue = "92391")]
908-
#[cfg(bootstrap)]
909-
impl const PartialOrd for Ordering {
910-
#[inline]
911-
fn partial_cmp(&self, other: &Ordering) -> Option<Ordering> {
912-
(*self as i32).partial_cmp(&(*other as i32))
913-
}
914-
}
915-
916880
/// Trait for types that form a [partial order](https://en.wikipedia.org/wiki/Partial_order).
917881
///
918882
/// The `lt`, `le`, `gt`, and `ge` methods of this trait can be called using

library/core/src/const_closure.rs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use crate::marker::Destruct;
2-
#[cfg(not(bootstrap))]
32
use crate::marker::Tuple;
43

54
/// Struct representing a closure with mutably borrowed data.
@@ -46,33 +45,6 @@ impl<'a, CapturedData: ?Sized, Function> ConstFnMutClosure<&'a mut CapturedData,
4645

4746
macro_rules! impl_fn_mut_tuple {
4847
($($var:ident)*) => {
49-
#[cfg(bootstrap)]
50-
#[allow(unused_parens)]
51-
impl<'a, $($var,)* ClosureArguments, Function, ClosureReturnValue> const
52-
FnOnce<ClosureArguments> for ConstFnMutClosure<($(&'a mut $var),*), Function>
53-
where
54-
Function: ~const Fn(($(&mut $var),*), ClosureArguments) -> ClosureReturnValue + ~const Destruct,
55-
{
56-
type Output = ClosureReturnValue;
57-
58-
extern "rust-call" fn call_once(mut self, args: ClosureArguments) -> Self::Output {
59-
self.call_mut(args)
60-
}
61-
}
62-
#[cfg(bootstrap)]
63-
#[allow(unused_parens)]
64-
impl<'a, $($var,)* ClosureArguments, Function, ClosureReturnValue> const
65-
FnMut<ClosureArguments> for ConstFnMutClosure<($(&'a mut $var),*), Function>
66-
where
67-
Function: ~const Fn(($(&mut $var),*), ClosureArguments)-> ClosureReturnValue + ~const Destruct,
68-
{
69-
extern "rust-call" fn call_mut(&mut self, args: ClosureArguments) -> Self::Output {
70-
#[allow(non_snake_case)]
71-
let ($($var),*) = &mut self.data;
72-
(self.func)(($($var),*), args)
73-
}
74-
}
75-
#[cfg(not(bootstrap))]
7648
#[allow(unused_parens)]
7749
impl<'a, $($var,)* ClosureArguments: Tuple, Function, ClosureReturnValue> const
7850
FnOnce<ClosureArguments> for ConstFnMutClosure<($(&'a mut $var),*), Function>
@@ -85,7 +57,6 @@ macro_rules! impl_fn_mut_tuple {
8557
self.call_mut(args)
8658
}
8759
}
88-
#[cfg(not(bootstrap))]
8960
#[allow(unused_parens)]
9061
impl<'a, $($var,)* ClosureArguments: Tuple, Function, ClosureReturnValue> const
9162
FnMut<ClosureArguments> for ConstFnMutClosure<($(&'a mut $var),*), Function>

library/core/src/future/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub use poll_fn::{poll_fn, PollFn};
4444
/// non-Send/Sync as well, and we don't want that.
4545
///
4646
/// It also simplifies the HIR lowering of `.await`.
47-
#[cfg_attr(not(bootstrap), lang = "ResumeTy")]
47+
#[lang = "ResumeTy"]
4848
#[doc(hidden)]
4949
#[unstable(feature = "gen_future", issue = "50547")]
5050
#[derive(Debug, Copy, Clone)]
@@ -61,7 +61,6 @@ unsafe impl Sync for ResumeTy {}
6161
/// This function returns a `GenFuture` underneath, but hides it in `impl Trait` to give
6262
/// better error messages (`impl Future` rather than `GenFuture<[closure.....]>`).
6363
// This is `const` to avoid extra errors after we recover from `const async fn`
64-
#[cfg_attr(bootstrap, lang = "from_generator")]
6564
#[doc(hidden)]
6665
#[unstable(feature = "gen_future", issue = "50547")]
6766
#[rustc_const_unstable(feature = "gen_future", issue = "50547")]
@@ -113,10 +112,10 @@ pub unsafe fn get_context<'a, 'b>(cx: ResumeTy) -> &'a mut Context<'b> {
113112
unsafe { &mut *cx.0.as_ptr().cast() }
114113
}
115114

116-
#[cfg_attr(not(bootstrap), lang = "identity_future")]
117115
#[doc(hidden)]
118116
#[unstable(feature = "gen_future", issue = "50547")]
119117
#[inline]
118+
#[lang = "identity_future"]
120119
pub const fn identity_future<O, Fut: Future<Output = O>>(f: Fut) -> Fut {
121120
f
122121
}

library/core/src/intrinsics.rs

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
#![allow(missing_docs)]
5656

5757
use crate::marker::DiscriminantKind;
58-
#[cfg(not(bootstrap))]
5958
use crate::marker::Tuple;
6059
use crate::mem;
6160

@@ -2175,66 +2174,6 @@ extern "rust-intrinsic" {
21752174
/// `unreachable_unchecked` is actually being reached. The bug is in *crate A*,
21762175
/// which violates the principle that a `const fn` must behave the same at
21772176
/// compile-time and at run-time. The unsafe code in crate B is fine.
2178-
#[cfg(bootstrap)]
2179-
#[rustc_const_unstable(feature = "const_eval_select", issue = "none")]
2180-
pub fn const_eval_select<ARG, F, G, RET>(arg: ARG, called_in_const: F, called_at_rt: G) -> RET
2181-
where
2182-
G: FnOnce<ARG, Output = RET>,
2183-
F: FnOnce<ARG, Output = RET>;
2184-
2185-
/// Selects which function to call depending on the context.
2186-
///
2187-
/// If this function is evaluated at compile-time, then a call to this
2188-
/// intrinsic will be replaced with a call to `called_in_const`. It gets
2189-
/// replaced with a call to `called_at_rt` otherwise.
2190-
///
2191-
/// # Type Requirements
2192-
///
2193-
/// The two functions must be both function items. They cannot be function
2194-
/// pointers or closures. The first function must be a `const fn`.
2195-
///
2196-
/// `arg` will be the tupled arguments that will be passed to either one of
2197-
/// the two functions, therefore, both functions must accept the same type of
2198-
/// arguments. Both functions must return RET.
2199-
///
2200-
/// # Safety
2201-
///
2202-
/// The two functions must behave observably equivalent. Safe code in other
2203-
/// crates may assume that calling a `const fn` at compile-time and at run-time
2204-
/// produces the same result. A function that produces a different result when
2205-
/// evaluated at run-time, or has any other observable side-effects, is
2206-
/// *unsound*.
2207-
///
2208-
/// Here is an example of how this could cause a problem:
2209-
/// ```no_run
2210-
/// #![feature(const_eval_select)]
2211-
/// #![feature(core_intrinsics)]
2212-
/// use std::hint::unreachable_unchecked;
2213-
/// use std::intrinsics::const_eval_select;
2214-
///
2215-
/// // Crate A
2216-
/// pub const fn inconsistent() -> i32 {
2217-
/// fn runtime() -> i32 { 1 }
2218-
/// const fn compiletime() -> i32 { 2 }
2219-
///
2220-
/// unsafe {
2221-
// // ⚠ This code violates the required equivalence of `compiletime`
2222-
/// // and `runtime`.
2223-
/// const_eval_select((), compiletime, runtime)
2224-
/// }
2225-
/// }
2226-
///
2227-
/// // Crate B
2228-
/// const X: i32 = inconsistent();
2229-
/// let x = inconsistent();
2230-
/// if x != X { unsafe { unreachable_unchecked(); }}
2231-
/// ```
2232-
///
2233-
/// This code causes Undefined Behavior when being run, since the
2234-
/// `unreachable_unchecked` is actually being reached. The bug is in *crate A*,
2235-
/// which violates the principle that a `const fn` must behave the same at
2236-
/// compile-time and at run-time. The unsafe code in crate B is fine.
2237-
#[cfg(not(bootstrap))]
22382177
#[rustc_const_unstable(feature = "const_eval_select", issue = "none")]
22392178
pub fn const_eval_select<ARG: Tuple, F, G, RET>(
22402179
arg: ARG,

library/core/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@
195195
#![feature(const_refs_to_cell)]
196196
#![feature(decl_macro)]
197197
#![feature(deprecated_suggestion)]
198-
#![cfg_attr(not(bootstrap), feature(derive_const))]
198+
#![feature(derive_const)]
199199
#![feature(doc_cfg)]
200200
#![feature(doc_notable_trait)]
201201
#![feature(rustdoc_internals)]

library/core/src/macros/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,7 +1461,6 @@ pub(crate) mod builtin {
14611461
/// [the reference]: ../../../reference/attributes/derive.html
14621462
#[unstable(feature = "derive_const", issue = "none")]
14631463
#[rustc_builtin_macro]
1464-
#[cfg(not(bootstrap))]
14651464
pub macro derive_const($item:item) {
14661465
/* compiler built-in */
14671466
}
@@ -1516,7 +1515,6 @@ pub(crate) mod builtin {
15161515
/// Attribute macro applied to a function to register it as a handler for allocation failure.
15171516
///
15181517
/// See also [`std::alloc::handle_alloc_error`](../../../std/alloc/fn.handle_alloc_error.html).
1519-
#[cfg(not(bootstrap))]
15201518
#[unstable(feature = "alloc_error_handler", issue = "51540")]
15211519
#[allow_internal_unstable(rustc_attrs)]
15221520
#[rustc_builtin_macro]
@@ -1553,7 +1551,6 @@ pub(crate) mod builtin {
15531551
issue = "23416",
15541552
reason = "placeholder syntax for type ascription"
15551553
)]
1556-
#[cfg(not(bootstrap))]
15571554
pub macro type_ascribe($expr:expr, $ty:ty) {
15581555
/* compiler built-in */
15591556
}

0 commit comments

Comments
 (0)