update cfgs

This commit is contained in:
Boxy 2025-04-02 21:28:54 +01:00
parent 609eacbb22
commit c93005ee65
24 changed files with 29 additions and 140 deletions

View file

@ -315,7 +315,7 @@ mod helper {
use super::*; use super::*;
pub(super) type ObligationTreeIdGenerator = impl Iterator<Item = ObligationTreeId>; pub(super) type ObligationTreeIdGenerator = impl Iterator<Item = ObligationTreeId>;
impl<O: ForestObligation> ObligationForest<O> { impl<O: ForestObligation> ObligationForest<O> {
#[cfg_attr(not(bootstrap), define_opaque(ObligationTreeIdGenerator))] #[define_opaque(ObligationTreeIdGenerator)]
pub fn new() -> ObligationForest<O> { pub fn new() -> ObligationForest<O> {
ObligationForest { ObligationForest {
nodes: vec![], nodes: vec![],

View file

@ -208,7 +208,7 @@ pub type LazyFallbackBundle = Arc<LazyLock<FluentBundle, impl FnOnce() -> Fluent
/// Return the default `FluentBundle` with standard "en-US" diagnostic messages. /// Return the default `FluentBundle` with standard "en-US" diagnostic messages.
#[instrument(level = "trace", skip(resources))] #[instrument(level = "trace", skip(resources))]
#[cfg_attr(not(bootstrap), define_opaque(LazyFallbackBundle))] #[define_opaque(LazyFallbackBundle)]
pub fn fallback_fluent_bundle( pub fn fallback_fluent_bundle(
resources: Vec<&'static str>, resources: Vec<&'static str>,
with_directionality_markers: bool, with_directionality_markers: bool,

View file

@ -454,7 +454,7 @@ mod helper {
/// Like [`SwitchTargets::target_for_value`], but returning the same type as /// Like [`SwitchTargets::target_for_value`], but returning the same type as
/// [`Terminator::successors`]. /// [`Terminator::successors`].
#[inline] #[inline]
#[cfg_attr(not(bootstrap), define_opaque(Successors))] #[define_opaque(Successors)]
pub fn successors_for_value(&self, value: u128) -> Successors<'_> { pub fn successors_for_value(&self, value: u128) -> Successors<'_> {
let target = self.target_for_value(value); let target = self.target_for_value(value);
(&[]).into_iter().copied().chain(Some(target)) (&[]).into_iter().copied().chain(Some(target))
@ -463,7 +463,7 @@ mod helper {
impl<'tcx> TerminatorKind<'tcx> { impl<'tcx> TerminatorKind<'tcx> {
#[inline] #[inline]
#[cfg_attr(not(bootstrap), define_opaque(Successors))] #[define_opaque(Successors)]
pub fn successors(&self) -> Successors<'_> { pub fn successors(&self) -> Successors<'_> {
use self::TerminatorKind::*; use self::TerminatorKind::*;
match *self { match *self {
@ -502,7 +502,7 @@ mod helper {
} }
#[inline] #[inline]
#[cfg_attr(not(bootstrap), define_opaque(SuccessorsMut))] #[define_opaque(SuccessorsMut)]
pub fn successors_mut(&mut self) -> SuccessorsMut<'_> { pub fn successors_mut(&mut self) -> SuccessorsMut<'_> {
use self::TerminatorKind::*; use self::TerminatorKind::*;
match *self { match *self {

View file

@ -25,7 +25,7 @@ pub trait EraseType: Copy {
pub type Erase<T: EraseType> = Erased<impl Copy>; pub type Erase<T: EraseType> = Erased<impl Copy>;
#[inline(always)] #[inline(always)]
#[cfg_attr(not(bootstrap), define_opaque(Erase))] #[define_opaque(Erase)]
pub fn erase<T: EraseType>(src: T) -> Erase<T> { pub fn erase<T: EraseType>(src: T) -> Erase<T> {
// Ensure the sizes match // Ensure the sizes match
const { const {
@ -49,7 +49,7 @@ pub fn erase<T: EraseType>(src: T) -> Erase<T> {
/// Restores an erased value. /// Restores an erased value.
#[inline(always)] #[inline(always)]
#[cfg_attr(not(bootstrap), define_opaque(Erase))] #[define_opaque(Erase)]
pub fn restore<T: EraseType>(value: Erase<T>) -> T { pub fn restore<T: EraseType>(value: Erase<T>) -> T {
let value: Erased<<T as EraseType>::Result> = value; let value: Erased<<T as EraseType>::Result> = value;
// See comment in `erase` for why we use `transmute_unchecked`. // See comment in `erase` for why we use `transmute_unchecked`.

View file

@ -6,7 +6,7 @@
// tidy-alphabetical-start // tidy-alphabetical-start
#![allow(rustc::usage_of_type_ir_inherent)] #![allow(rustc::usage_of_type_ir_inherent)]
#![cfg_attr(not(bootstrap), allow(rustc::usage_of_type_ir_traits))] #![allow(rustc::usage_of_type_ir_traits)]
// tidy-alphabetical-end // tidy-alphabetical-end
pub mod canonicalizer; pub mod canonicalizer;

View file

@ -1,12 +1,12 @@
// tidy-alphabetical-start // tidy-alphabetical-start
#![allow(rustc::usage_of_ty_tykind)] #![allow(rustc::usage_of_ty_tykind)]
#![allow(rustc::usage_of_type_ir_inherent)] #![allow(rustc::usage_of_type_ir_inherent)]
#![allow(rustc::usage_of_type_ir_traits)]
#![cfg_attr( #![cfg_attr(
feature = "nightly", feature = "nightly",
feature(associated_type_defaults, never_type, rustc_attrs, negative_impls) feature(associated_type_defaults, never_type, rustc_attrs, negative_impls)
)] )]
#![cfg_attr(feature = "nightly", allow(internal_features))] #![cfg_attr(feature = "nightly", allow(internal_features))]
#![cfg_attr(not(bootstrap), allow(rustc::usage_of_type_ir_traits))]
// tidy-alphabetical-end // tidy-alphabetical-end
extern crate self as rustc_type_ir; extern crate self as rustc_type_ir;

View file

@ -16,22 +16,22 @@ unsafe extern "Rust" {
// otherwise. // otherwise.
#[rustc_allocator] #[rustc_allocator]
#[rustc_nounwind] #[rustc_nounwind]
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)] #[rustc_std_internal_symbol]
fn __rust_alloc(size: usize, align: usize) -> *mut u8; fn __rust_alloc(size: usize, align: usize) -> *mut u8;
#[rustc_deallocator] #[rustc_deallocator]
#[rustc_nounwind] #[rustc_nounwind]
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)] #[rustc_std_internal_symbol]
fn __rust_dealloc(ptr: *mut u8, size: usize, align: usize); fn __rust_dealloc(ptr: *mut u8, size: usize, align: usize);
#[rustc_reallocator] #[rustc_reallocator]
#[rustc_nounwind] #[rustc_nounwind]
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)] #[rustc_std_internal_symbol]
fn __rust_realloc(ptr: *mut u8, old_size: usize, align: usize, new_size: usize) -> *mut u8; fn __rust_realloc(ptr: *mut u8, old_size: usize, align: usize, new_size: usize) -> *mut u8;
#[rustc_allocator_zeroed] #[rustc_allocator_zeroed]
#[rustc_nounwind] #[rustc_nounwind]
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)] #[rustc_std_internal_symbol]
fn __rust_alloc_zeroed(size: usize, align: usize) -> *mut u8; fn __rust_alloc_zeroed(size: usize, align: usize) -> *mut u8;
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)] #[rustc_std_internal_symbol]
static __rust_no_alloc_shim_is_unstable: u8; static __rust_no_alloc_shim_is_unstable: u8;
} }
@ -360,7 +360,7 @@ unsafe extern "Rust" {
// This is the magic symbol to call the global alloc error handler. rustc generates // This is the magic symbol to call the global alloc error handler. rustc generates
// it to call `__rg_oom` if there is a `#[alloc_error_handler]`, or to call the // it to call `__rg_oom` if there is a `#[alloc_error_handler]`, or to call the
// default implementations below (`__rdl_oom`) otherwise. // default implementations below (`__rdl_oom`) otherwise.
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)] #[rustc_std_internal_symbol]
fn __rust_alloc_error_handler(size: usize, align: usize) -> !; fn __rust_alloc_error_handler(size: usize, align: usize) -> !;
} }
@ -427,7 +427,7 @@ pub mod __alloc_error_handler {
unsafe extern "Rust" { unsafe extern "Rust" {
// This symbol is emitted by rustc next to __rust_alloc_error_handler. // This symbol is emitted by rustc next to __rust_alloc_error_handler.
// Its value depends on the -Zoom={panic,abort} compiler option. // Its value depends on the -Zoom={panic,abort} compiler option.
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)] #[rustc_std_internal_symbol]
static __rust_alloc_error_handler_should_panic: u8; static __rust_alloc_error_handler_should_panic: u8;
} }

View file

@ -32,8 +32,6 @@ check-cfg = [
'cfg(bootstrap)', 'cfg(bootstrap)',
'cfg(no_fp_fmt_parse)', 'cfg(no_fp_fmt_parse)',
'cfg(stdarch_intel_sde)', 'cfg(stdarch_intel_sde)',
# #[cfg(bootstrap)]
'cfg(target_feature, values("vector-enhancements-1"))',
# core use #[path] imports to portable-simd `core_simd` crate # core use #[path] imports to portable-simd `core_simd` crate
# and to stdarch `core_arch` crate which messes-up with Cargo list # and to stdarch `core_arch` crate which messes-up with Cargo list
# of declared features, we therefor expect any feature cfg # of declared features, we therefor expect any feature cfg

View file

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

View file

@ -1515,19 +1515,6 @@ unsafe fn run(fmt: &mut Formatter<'_>, arg: &rt::Placeholder, args: &[rt::Argume
// which guarantees the indexes are always within bounds. // which guarantees the indexes are always within bounds.
unsafe { (getcount(args, &arg.width), getcount(args, &arg.precision)) }; unsafe { (getcount(args, &arg.width), getcount(args, &arg.precision)) };
#[cfg(bootstrap)]
let options =
*FormattingOptions { flags: flags::ALWAYS_SET | arg.flags << 21, width: 0, precision: 0 }
.align(match arg.align {
rt::Alignment::Left => Some(Alignment::Left),
rt::Alignment::Right => Some(Alignment::Right),
rt::Alignment::Center => Some(Alignment::Center),
rt::Alignment::Unknown => None,
})
.fill(arg.fill)
.width(width)
.precision(precision);
#[cfg(not(bootstrap))]
let options = FormattingOptions { flags: arg.flags, width, precision }; let options = FormattingOptions { flags: arg.flags, width, precision };
// Extract the correct argument // Extract the correct argument
@ -1544,21 +1531,6 @@ unsafe fn run(fmt: &mut Formatter<'_>, arg: &rt::Placeholder, args: &[rt::Argume
unsafe { value.fmt(fmt) } unsafe { value.fmt(fmt) }
} }
#[cfg(bootstrap)]
unsafe fn getcount(args: &[rt::Argument<'_>], cnt: &rt::Count) -> Option<u16> {
match *cnt {
rt::Count::Is(n) => Some(n as u16),
rt::Count::Implied => None,
rt::Count::Param(i) => {
debug_assert!(i < args.len());
// SAFETY: cnt and args come from the same Arguments,
// which guarantees this index is always within bounds.
unsafe { args.get_unchecked(i).as_u16() }
}
}
}
#[cfg(not(bootstrap))]
unsafe fn getcount(args: &[rt::Argument<'_>], cnt: &rt::Count) -> u16 { unsafe fn getcount(args: &[rt::Argument<'_>], cnt: &rt::Count) -> u16 {
match *cnt { match *cnt {
rt::Count::Is(n) => n, rt::Count::Is(n) => n,

View file

@ -11,10 +11,6 @@ use crate::ptr::NonNull;
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub struct Placeholder { pub struct Placeholder {
pub position: usize, pub position: usize,
#[cfg(bootstrap)]
pub fill: char,
#[cfg(bootstrap)]
pub align: Alignment,
pub flags: u32, pub flags: u32,
pub precision: Count, pub precision: Count,
pub width: Count, pub width: Count,
@ -23,38 +19,17 @@ pub struct Placeholder {
#[cfg(bootstrap)] #[cfg(bootstrap)]
impl Placeholder { impl Placeholder {
#[inline] #[inline]
pub const fn new( pub const fn new(position: usize, flags: u32, precision: Count, width: Count) -> Self {
position: usize, Self { position, flags, precision, width }
fill: char,
align: Alignment,
flags: u32,
precision: Count,
width: Count,
) -> Self {
Self { position, fill, align, flags, precision, width }
} }
} }
#[cfg(bootstrap)]
#[lang = "format_alignment"]
#[derive(Copy, Clone, PartialEq, Eq)]
pub enum Alignment {
Left,
Right,
Center,
Unknown,
}
/// Used by [width](https://doc.rust-lang.org/std/fmt/#width) /// Used by [width](https://doc.rust-lang.org/std/fmt/#width)
/// and [precision](https://doc.rust-lang.org/std/fmt/#precision) specifiers. /// and [precision](https://doc.rust-lang.org/std/fmt/#precision) specifiers.
#[lang = "format_count"] #[lang = "format_count"]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub enum Count { pub enum Count {
/// Specified with a literal number, stores the value /// Specified with a literal number, stores the value
#[cfg(bootstrap)]
Is(usize),
/// Specified with a literal number, stores the value
#[cfg(not(bootstrap))]
Is(u16), Is(u16),
/// Specified using `$` and `*` syntaxes, stores the index into `args` /// Specified using `$` and `*` syntaxes, stores the index into `args`
Param(usize), Param(usize),

View file

@ -2304,20 +2304,8 @@ pub unsafe fn truncf128(x: f128) -> f128;
/// [`f16::round_ties_even`](../../std/primitive.f16.html#method.round_ties_even) /// [`f16::round_ties_even`](../../std/primitive.f16.html#method.round_ties_even)
#[rustc_intrinsic] #[rustc_intrinsic]
#[rustc_nounwind] #[rustc_nounwind]
#[cfg(not(bootstrap))]
pub fn round_ties_even_f16(x: f16) -> f16; pub fn round_ties_even_f16(x: f16) -> f16;
/// To be removed on next bootstrap bump.
#[cfg(bootstrap)]
pub fn round_ties_even_f16(x: f16) -> f16 {
#[rustc_intrinsic]
#[rustc_nounwind]
unsafe fn rintf16(x: f16) -> f16;
// SAFETY: this intrinsic isn't actually unsafe
unsafe { rintf16(x) }
}
/// Returns the nearest integer to an `f32`. Rounds half-way cases to the number with an even /// Returns the nearest integer to an `f32`. Rounds half-way cases to the number with an even
/// least significant digit. /// least significant digit.
/// ///
@ -2325,20 +2313,8 @@ pub fn round_ties_even_f16(x: f16) -> f16 {
/// [`f32::round_ties_even`](../../std/primitive.f32.html#method.round_ties_even) /// [`f32::round_ties_even`](../../std/primitive.f32.html#method.round_ties_even)
#[rustc_intrinsic] #[rustc_intrinsic]
#[rustc_nounwind] #[rustc_nounwind]
#[cfg(not(bootstrap))]
pub fn round_ties_even_f32(x: f32) -> f32; pub fn round_ties_even_f32(x: f32) -> f32;
/// To be removed on next bootstrap bump.
#[cfg(bootstrap)]
pub fn round_ties_even_f32(x: f32) -> f32 {
#[rustc_intrinsic]
#[rustc_nounwind]
unsafe fn rintf32(x: f32) -> f32;
// SAFETY: this intrinsic isn't actually unsafe
unsafe { rintf32(x) }
}
/// Provided for compatibility with stdarch. DO NOT USE. /// Provided for compatibility with stdarch. DO NOT USE.
#[inline(always)] #[inline(always)]
pub unsafe fn rintf32(x: f32) -> f32 { pub unsafe fn rintf32(x: f32) -> f32 {
@ -2352,20 +2328,8 @@ pub unsafe fn rintf32(x: f32) -> f32 {
/// [`f64::round_ties_even`](../../std/primitive.f64.html#method.round_ties_even) /// [`f64::round_ties_even`](../../std/primitive.f64.html#method.round_ties_even)
#[rustc_intrinsic] #[rustc_intrinsic]
#[rustc_nounwind] #[rustc_nounwind]
#[cfg(not(bootstrap))]
pub fn round_ties_even_f64(x: f64) -> f64; pub fn round_ties_even_f64(x: f64) -> f64;
/// To be removed on next bootstrap bump.
#[cfg(bootstrap)]
pub fn round_ties_even_f64(x: f64) -> f64 {
#[rustc_intrinsic]
#[rustc_nounwind]
unsafe fn rintf64(x: f64) -> f64;
// SAFETY: this intrinsic isn't actually unsafe
unsafe { rintf64(x) }
}
/// Provided for compatibility with stdarch. DO NOT USE. /// Provided for compatibility with stdarch. DO NOT USE.
#[inline(always)] #[inline(always)]
pub unsafe fn rintf64(x: f64) -> f64 { pub unsafe fn rintf64(x: f64) -> f64 {
@ -2379,20 +2343,8 @@ pub unsafe fn rintf64(x: f64) -> f64 {
/// [`f128::round_ties_even`](../../std/primitive.f128.html#method.round_ties_even) /// [`f128::round_ties_even`](../../std/primitive.f128.html#method.round_ties_even)
#[rustc_intrinsic] #[rustc_intrinsic]
#[rustc_nounwind] #[rustc_nounwind]
#[cfg(not(bootstrap))]
pub fn round_ties_even_f128(x: f128) -> f128; pub fn round_ties_even_f128(x: f128) -> f128;
/// To be removed on next bootstrap bump.
#[cfg(bootstrap)]
pub fn round_ties_even_f128(x: f128) -> f128 {
#[rustc_intrinsic]
#[rustc_nounwind]
unsafe fn rintf128(x: f128) -> f128;
// SAFETY: this intrinsic isn't actually unsafe
unsafe { rintf128(x) }
}
/// Returns the nearest integer to an `f16`. Rounds half-way cases away from zero. /// Returns the nearest integer to an `f16`. Rounds half-way cases away from zero.
/// ///
/// The stabilized version of this intrinsic is /// The stabilized version of this intrinsic is

View file

@ -1753,7 +1753,6 @@ pub(crate) mod builtin {
reason = "`type_alias_impl_trait` has open design concerns" reason = "`type_alias_impl_trait` has open design concerns"
)] )]
#[rustc_builtin_macro] #[rustc_builtin_macro]
#[cfg(not(bootstrap))]
pub macro define_opaque($($tt:tt)*) { pub macro define_opaque($($tt:tt)*) {
/* compiler built-in */ /* compiler built-in */
} }

View file

@ -25,15 +25,15 @@ macro_rules! pattern_type {
)] )]
pub trait RangePattern { pub trait RangePattern {
/// Trait version of the inherent `MIN` assoc const. /// Trait version of the inherent `MIN` assoc const.
#[cfg_attr(not(bootstrap), lang = "RangeMin")] #[lang = "RangeMin"]
const MIN: Self; const MIN: Self;
/// Trait version of the inherent `MIN` assoc const. /// Trait version of the inherent `MIN` assoc const.
#[cfg_attr(not(bootstrap), lang = "RangeMax")] #[lang = "RangeMax"]
const MAX: Self; const MAX: Self;
/// A compile-time helper to subtract 1 for exclusive ranges. /// A compile-time helper to subtract 1 for exclusive ranges.
#[cfg_attr(not(bootstrap), lang = "RangeSub")] #[lang = "RangeSub"]
#[track_caller] #[track_caller]
fn sub_one(self) -> Self; fn sub_one(self) -> Self;
} }

View file

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

View file

@ -117,5 +117,4 @@ pub use crate::macros::builtin::deref;
issue = "63063", issue = "63063",
reason = "`type_alias_impl_trait` has open design concerns" reason = "`type_alias_impl_trait` has open design concerns"
)] )]
#[cfg(not(bootstrap))]
pub use crate::macros::builtin::define_opaque; pub use crate::macros::builtin::define_opaque;

View file

@ -38,7 +38,6 @@ fn rust_2024_expr() {
} }
#[test] #[test]
#[cfg(not(bootstrap))]
fn temp_lifetime() { fn temp_lifetime() {
// Check that temporary lifetimes work as in Rust 2021. // Check that temporary lifetimes work as in Rust 2021.
// Regression test for https://github.com/rust-lang/rust/issues/138596 // Regression test for https://github.com/rust-lang/rust/issues/138596

View file

@ -79,11 +79,11 @@ cfg_if::cfg_if! {
unsafe extern "C" { unsafe extern "C" {
/// Handler in std called when a panic object is dropped outside of /// Handler in std called when a panic object is dropped outside of
/// `catch_unwind`. /// `catch_unwind`.
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)] #[rustc_std_internal_symbol]
fn __rust_drop_panic() -> !; fn __rust_drop_panic() -> !;
/// Handler in std called when a foreign exception is caught. /// Handler in std called when a foreign exception is caught.
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)] #[rustc_std_internal_symbol]
fn __rust_foreign_exception() -> !; fn __rust_foreign_exception() -> !;
} }

View file

@ -9,7 +9,6 @@
#![deny(unsafe_code)] #![deny(unsafe_code)]
// proc_macros anyway don't work on wasm hosts so while both sides of this bridge can // proc_macros anyway don't work on wasm hosts so while both sides of this bridge can
// be built with different versions of rustc, the wasm ABI changes don't really matter. // be built with different versions of rustc, the wasm ABI changes don't really matter.
#![cfg_attr(bootstrap, allow(unknown_lints))]
#![allow(wasm_c_abi)] #![allow(wasm_c_abi)]
use std::hash::Hash; use std::hash::Hash;

View file

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

View file

@ -432,7 +432,7 @@ mod helper {
use super::*; use super::*;
pub(super) type LazyResolve = impl (FnOnce() -> Capture) + Send + Sync + UnwindSafe; pub(super) type LazyResolve = impl (FnOnce() -> Capture) + Send + Sync + UnwindSafe;
#[cfg_attr(not(bootstrap), define_opaque(LazyResolve))] #[define_opaque(LazyResolve)]
pub(super) fn lazy_resolve(mut capture: Capture) -> LazyResolve { pub(super) fn lazy_resolve(mut capture: Capture) -> LazyResolve {
move || { move || {
// Use the global backtrace lock to synchronize this as it's a // Use the global backtrace lock to synchronize this as it's a

View file

@ -55,14 +55,14 @@ pub static EMPTY_PANIC: fn(&'static str) -> ! =
// hook up these functions, but it is not this day! // hook up these functions, but it is not this day!
#[allow(improper_ctypes)] #[allow(improper_ctypes)]
unsafe extern "C" { unsafe extern "C" {
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)] #[rustc_std_internal_symbol]
fn __rust_panic_cleanup(payload: *mut u8) -> *mut (dyn Any + Send + 'static); fn __rust_panic_cleanup(payload: *mut u8) -> *mut (dyn Any + Send + 'static);
} }
unsafe extern "Rust" { unsafe extern "Rust" {
/// `PanicPayload` lazily performs allocation only when needed (this avoids /// `PanicPayload` lazily performs allocation only when needed (this avoids
/// allocations when using the "abort" panic runtime). /// allocations when using the "abort" panic runtime).
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)] #[rustc_std_internal_symbol]
fn __rust_start_panic(payload: &mut dyn PanicPayload) -> u32; fn __rust_start_panic(payload: &mut dyn PanicPayload) -> u32;
} }

View file

@ -109,7 +109,6 @@ pub use core::prelude::v1::deref;
issue = "63063", issue = "63063",
reason = "`type_alias_impl_trait` has open design concerns" reason = "`type_alias_impl_trait` has open design concerns"
)] )]
#[cfg(not(bootstrap))]
pub use core::prelude::v1::define_opaque; pub use core::prelude::v1::define_opaque;
// The file so far is equivalent to core/src/prelude/v1.rs. It is duplicated // The file so far is equivalent to core/src/prelude/v1.rs. It is duplicated

View file

@ -459,9 +459,6 @@ fn profiler_runtime() {
#[test] #[test]
fn asm_support() { fn asm_support() {
let asms = [ let asms = [
#[cfg(bootstrap)]
("avr-unknown-gnu-atmega328", false),
#[cfg(not(bootstrap))]
("avr-none", false), ("avr-none", false),
("i686-unknown-netbsd", true), ("i686-unknown-netbsd", true),
("riscv32gc-unknown-linux-gnu", true), ("riscv32gc-unknown-linux-gnu", true),