1
Fork 0

Step all bootstrap cfgs forward

This also takes care of other bootstrap-related changes.
This commit is contained in:
Mark Rousskov 2024-02-05 07:34:48 -05:00
parent 9784a14859
commit 9a5034a20e
26 changed files with 28 additions and 161 deletions

View file

@ -31,17 +31,17 @@ mod newtype;
/// - `#[max = 0xFFFF_FFFD]`: specifies the max value, which allows niche /// - `#[max = 0xFFFF_FFFD]`: specifies the max value, which allows niche
/// optimizations. The default max value is 0xFFFF_FF00. /// optimizations. The default max value is 0xFFFF_FF00.
/// - `#[gate_rustc_only]`: makes parts of the generated code nightly-only. /// - `#[gate_rustc_only]`: makes parts of the generated code nightly-only.
///
/// `SpecOptionPartialEq` is specialized by this macro, so using it requires enabling
/// `#![feature(min_specialization)]` for the crate.
#[proc_macro] #[proc_macro]
#[cfg_attr( #[cfg_attr(
feature = "nightly", feature = "nightly",
allow_internal_unstable(step_trait, rustc_attrs, trusted_step, spec_option_partial_eq) allow_internal_unstable(
step_trait,
rustc_attrs,
trusted_step,
spec_option_partial_eq,
min_specialization
)
)] )]
// FIXME: Remove the above comment about `min_specialization` once bootstrap is bumped,
// and the corresponding one on SpecOptionPartialEq
#[cfg_attr(all(feature = "nightly", not(bootstrap)), allow_internal_unstable(min_specialization))]
pub fn newtype_index(input: TokenStream) -> TokenStream { pub fn newtype_index(input: TokenStream) -> TokenStream {
newtype::newtype(input) newtype::newtype(input)
} }

View file

@ -34,7 +34,7 @@
#![feature(if_let_guard)] #![feature(if_let_guard)]
#![feature(iter_order_by)] #![feature(iter_order_by)]
#![feature(let_chains)] #![feature(let_chains)]
#![cfg_attr(not(bootstrap), feature(trait_upcasting))] #![feature(trait_upcasting)]
#![feature(min_specialization)] #![feature(min_specialization)]
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#![deny(rustc::untranslatable_diagnostic)] #![deny(rustc::untranslatable_diagnostic)]

View file

@ -49,7 +49,7 @@
#![feature(associated_type_bounds)] #![feature(associated_type_bounds)]
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#![feature(control_flow_enum)] #![feature(control_flow_enum)]
#![cfg_attr(not(bootstrap), feature(trait_upcasting))] #![feature(trait_upcasting)]
#![feature(try_blocks)] #![feature(try_blocks)]
#![feature(decl_macro)] #![feature(decl_macro)]
#![feature(extract_if)] #![feature(extract_if)]

View file

@ -47,7 +47,7 @@ pub trait AsyncIterator {
/// Rust's usual rules apply: calls must never cause undefined behavior /// Rust's usual rules apply: calls must never cause undefined behavior
/// (memory corruption, incorrect use of `unsafe` functions, or the like), /// (memory corruption, incorrect use of `unsafe` functions, or the like),
/// regardless of the async iterator's state. /// regardless of the async iterator's state.
#[cfg_attr(not(bootstrap), lang = "async_iterator_poll_next")] #[lang = "async_iterator_poll_next"]
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>>; fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>>;
/// Returns the bounds on the remaining length of the async iterator. /// Returns the bounds on the remaining length of the async iterator.
@ -145,7 +145,7 @@ pub trait IntoAsyncIterator {
type IntoAsyncIter: AsyncIterator<Item = Self::Item>; type IntoAsyncIter: AsyncIterator<Item = Self::Item>;
/// Converts `self` into an async iterator /// Converts `self` into an async iterator
#[cfg_attr(not(bootstrap), lang = "into_async_iter_into_iter")] #[lang = "into_async_iter_into_iter"]
fn into_async_iter(self) -> Self::IntoAsyncIter; fn into_async_iter(self) -> Self::IntoAsyncIter;
} }

View file

@ -2567,18 +2567,9 @@ extern "rust-intrinsic" {
/// matter what*. /// matter what*.
#[rustc_const_unstable(feature = "is_val_statically_known", issue = "none")] #[rustc_const_unstable(feature = "is_val_statically_known", issue = "none")]
#[rustc_nounwind] #[rustc_nounwind]
#[cfg(not(bootstrap))]
pub fn is_val_statically_known<T: Copy>(arg: T) -> bool; pub fn is_val_statically_known<T: Copy>(arg: T) -> bool;
} }
// FIXME: Seems using `unstable` here completely ignores `rustc_allow_const_fn_unstable`
// and thus compiling stage0 core doesn't work.
#[rustc_const_stable(feature = "is_val_statically_known", since = "0.0.0")]
#[cfg(bootstrap)]
pub const unsafe fn is_val_statically_known<T: Copy>(_arg: T) -> bool {
false
}
// Some functions are defined here because they accidentally got made // Some functions are defined here because they accidentally got made
// available in this module on stable. See <https://github.com/rust-lang/rust/issues/15702>. // available in this module on stable. See <https://github.com/rust-lang/rust/issues/15702>.
// (`transmute` also falls into this category, but it cannot be wrapped due to the // (`transmute` also falls into this category, but it cannot be wrapped due to the

View file

@ -105,7 +105,6 @@
//! } //! }
//! //!
//! #[custom_mir(dialect = "runtime", phase = "optimized")] //! #[custom_mir(dialect = "runtime", phase = "optimized")]
#![cfg_attr(bootstrap, doc = "#[cfg(any())]")] // disable the following function in doctests when `bootstrap` is set
//! fn push_and_pop<T>(v: &mut Vec<T>, value: T) { //! fn push_and_pop<T>(v: &mut Vec<T>, value: T) {
//! mir!( //! mir!(
//! let _unused; //! let _unused;
@ -357,7 +356,6 @@ define!("mir_unwind_resume",
define!("mir_storage_live", fn StorageLive<T>(local: T)); define!("mir_storage_live", fn StorageLive<T>(local: T));
define!("mir_storage_dead", fn StorageDead<T>(local: T)); define!("mir_storage_dead", fn StorageDead<T>(local: T));
#[cfg(not(bootstrap))]
define!("mir_assume", fn Assume(operand: bool)); define!("mir_assume", fn Assume(operand: bool));
define!("mir_deinit", fn Deinit<T>(place: T)); define!("mir_deinit", fn Deinit<T>(place: T));
define!("mir_checked", fn Checked<T>(binop: T) -> (T, bool)); define!("mir_checked", fn Checked<T>(binop: T) -> (T, bool));

View file

@ -111,7 +111,6 @@
// //
// Library features: // Library features:
// tidy-alphabetical-start // tidy-alphabetical-start
#![cfg_attr(not(bootstrap), feature(offset_of_nested))]
#![feature(char_indices_offset)] #![feature(char_indices_offset)]
#![feature(const_align_of_val)] #![feature(const_align_of_val)]
#![feature(const_align_of_val_raw)] #![feature(const_align_of_val_raw)]
@ -181,6 +180,7 @@
#![feature(maybe_uninit_uninit_array)] #![feature(maybe_uninit_uninit_array)]
#![feature(non_null_convenience)] #![feature(non_null_convenience)]
#![feature(offset_of_enum)] #![feature(offset_of_enum)]
#![feature(offset_of_nested)]
#![feature(panic_internals)] #![feature(panic_internals)]
#![feature(ptr_alignment_type)] #![feature(ptr_alignment_type)]
#![feature(ptr_metadata)] #![feature(ptr_metadata)]

View file

@ -225,77 +225,6 @@ marker_impls! {
{T: ?Sized} &T, {T: ?Sized} &T,
} }
/// Required trait for constants used in pattern matches.
///
/// Any type that derives `Eq` automatically implements this trait, *regardless*
/// of whether its type parameters implement `Eq`.
///
/// This is a hack to work around a limitation in our type system.
///
/// # Background
///
/// We want to require that types of consts used in pattern matches
/// have the attribute `#[derive(PartialEq, Eq)]`.
///
/// In a more ideal world, we could check that requirement by just checking that
/// the given type implements both the `StructuralPartialEq` trait *and*
/// the `Eq` trait. However, you can have ADTs that *do* `derive(PartialEq, Eq)`,
/// and be a case that we want the compiler to accept, and yet the constant's
/// type fails to implement `Eq`.
///
/// Namely, a case like this:
///
/// ```rust
/// #[derive(PartialEq, Eq)]
/// struct Wrap<X>(X);
///
/// fn higher_order(_: &()) { }
///
/// const CFN: Wrap<fn(&())> = Wrap(higher_order);
///
/// #[allow(pointer_structural_match)]
/// fn main() {
/// match CFN {
/// CFN => {}
/// _ => {}
/// }
/// }
/// ```
///
/// (The problem in the above code is that `Wrap<fn(&())>` does not implement
/// `PartialEq`, nor `Eq`, because `for<'a> fn(&'a _)` does not implement those
/// traits.)
///
/// Therefore, we cannot rely on naive check for `StructuralPartialEq` and
/// mere `Eq`.
///
/// As a hack to work around this, we use two separate traits injected by each
/// of the two derives (`#[derive(PartialEq)]` and `#[derive(Eq)]`) and check
/// that both of them are present as part of structural-match checking.
#[unstable(feature = "structural_match", issue = "31434")]
#[diagnostic::on_unimplemented(message = "the type `{Self}` does not `#[derive(Eq)]`")]
#[lang = "structural_teq"]
#[cfg(bootstrap)]
pub trait StructuralEq {
// Empty.
}
// FIXME: Remove special cases of these types from the compiler pattern checking code and always check `T: StructuralEq` instead
marker_impls! {
#[unstable(feature = "structural_match", issue = "31434")]
#[cfg(bootstrap)]
StructuralEq for
usize, u8, u16, u32, u64, u128,
isize, i8, i16, i32, i64, i128,
bool,
char,
str /* Technically requires `[u8]: StructuralEq` */,
(),
{T, const N: usize} [T; N],
{T} [T],
{T: ?Sized} &T,
}
/// Types whose values can be duplicated simply by copying bits. /// Types whose values can be duplicated simply by copying bits.
/// ///
/// By default, variable bindings have 'move semantics.' In other /// By default, variable bindings have 'move semantics.' In other
@ -860,10 +789,6 @@ impl<T: ?Sized> Default for PhantomData<T> {
#[unstable(feature = "structural_match", issue = "31434")] #[unstable(feature = "structural_match", issue = "31434")]
impl<T: ?Sized> StructuralPartialEq for PhantomData<T> {} impl<T: ?Sized> StructuralPartialEq for PhantomData<T> {}
#[unstable(feature = "structural_match", issue = "31434")]
#[cfg(bootstrap)]
impl<T: ?Sized> StructuralEq for PhantomData<T> {}
/// Compiler-internal trait used to indicate the type of enum discriminants. /// Compiler-internal trait used to indicate the type of enum discriminants.
/// ///
/// This trait is automatically implemented for every type and does not add any /// This trait is automatically implemented for every type and does not add any
@ -1041,22 +966,8 @@ pub trait PointerLike {}
#[unstable(feature = "adt_const_params", issue = "95174")] #[unstable(feature = "adt_const_params", issue = "95174")]
#[diagnostic::on_unimplemented(message = "`{Self}` can't be used as a const parameter type")] #[diagnostic::on_unimplemented(message = "`{Self}` can't be used as a const parameter type")]
#[allow(multiple_supertrait_upcastable)] #[allow(multiple_supertrait_upcastable)]
#[cfg(not(bootstrap))]
pub trait ConstParamTy: StructuralPartialEq + Eq {} pub trait ConstParamTy: StructuralPartialEq + Eq {}
/// A marker for types which can be used as types of `const` generic parameters.
///
/// These types must have a proper equivalence relation (`Eq`) and it must be automatically
/// derived (`StructuralPartialEq`). There's a hard-coded check in the compiler ensuring
/// that all fields are also `ConstParamTy`, which implies that recursively, all fields
/// are `StructuralPartialEq`.
#[lang = "const_param_ty"]
#[unstable(feature = "adt_const_params", issue = "95174")]
#[rustc_on_unimplemented(message = "`{Self}` can't be used as a const parameter type")]
#[allow(multiple_supertrait_upcastable)]
#[cfg(bootstrap)]
pub trait ConstParamTy: StructuralEq + StructuralPartialEq + Eq {}
/// Derive macro generating an impl of the trait `ConstParamTy`. /// Derive macro generating an impl of the trait `ConstParamTy`.
#[rustc_builtin_macro] #[rustc_builtin_macro]
#[unstable(feature = "adt_const_params", issue = "95174")] #[unstable(feature = "adt_const_params", issue = "95174")]

View file

@ -1393,19 +1393,9 @@ impl<T> SizedTypeProperties for T {}
/// ///
/// assert_eq!(mem::offset_of!(Option<&u8>, Some.0), 0); /// assert_eq!(mem::offset_of!(Option<&u8>, Some.0), 0);
/// ``` /// ```
#[cfg(not(bootstrap))]
#[stable(feature = "offset_of", since = "1.77.0")] #[stable(feature = "offset_of", since = "1.77.0")]
#[allow_internal_unstable(builtin_syntax, hint_must_use)] #[allow_internal_unstable(builtin_syntax, hint_must_use)]
pub macro offset_of($Container:ty, $($fields:expr)+ $(,)?) { pub macro offset_of($Container:ty, $($fields:expr)+ $(,)?) {
// The `{}` is for better error messages // The `{}` is for better error messages
crate::hint::must_use({builtin # offset_of($Container, $($fields)+)}) crate::hint::must_use({builtin # offset_of($Container, $($fields)+)})
} }
#[cfg(bootstrap)]
#[stable(feature = "offset_of", since = "1.77.0")]
#[allow_internal_unstable(builtin_syntax, hint_must_use)]
#[allow(missing_docs)]
pub macro offset_of($Container:ty, $($fields:tt).+ $(,)?) {
// The `{}` is for better error messages
crate::hint::must_use({builtin # offset_of($Container, $($fields).+)})
}

View file

@ -4,8 +4,6 @@ use crate::cmp::Ordering;
use crate::fmt; use crate::fmt;
use crate::hash::{Hash, Hasher}; use crate::hash::{Hash, Hasher};
use crate::intrinsics; use crate::intrinsics;
#[cfg(bootstrap)]
use crate::marker::StructuralEq;
use crate::marker::StructuralPartialEq; use crate::marker::StructuralPartialEq;
use crate::ops::{BitOr, BitOrAssign, Div, Neg, Rem}; use crate::ops::{BitOr, BitOrAssign, Div, Neg, Rem};
use crate::ptr; use crate::ptr;
@ -583,10 +581,6 @@ macro_rules! nonzero_integer {
#[$stability] #[$stability]
impl Eq for $Ty {} impl Eq for $Ty {}
#[unstable(feature = "structural_match", issue = "31434")]
#[cfg(bootstrap)]
impl StructuralEq for $Ty {}
#[$stability] #[$stability]
impl PartialOrd for $Ty { impl PartialOrd for $Ty {
#[inline] #[inline]

View file

@ -8,7 +8,7 @@ use crate::marker::Tuple;
#[rustc_paren_sugar] #[rustc_paren_sugar]
#[fundamental] #[fundamental]
#[must_use = "async closures are lazy and do nothing unless called"] #[must_use = "async closures are lazy and do nothing unless called"]
#[cfg_attr(not(bootstrap), lang = "async_fn")] #[lang = "async_fn"]
pub trait AsyncFn<Args: Tuple>: AsyncFnMut<Args> { pub trait AsyncFn<Args: Tuple>: AsyncFnMut<Args> {
/// Future returned by [`AsyncFn::async_call`]. /// Future returned by [`AsyncFn::async_call`].
#[unstable(feature = "async_fn_traits", issue = "none")] #[unstable(feature = "async_fn_traits", issue = "none")]
@ -28,7 +28,7 @@ pub trait AsyncFn<Args: Tuple>: AsyncFnMut<Args> {
#[rustc_paren_sugar] #[rustc_paren_sugar]
#[fundamental] #[fundamental]
#[must_use = "async closures are lazy and do nothing unless called"] #[must_use = "async closures are lazy and do nothing unless called"]
#[cfg_attr(not(bootstrap), lang = "async_fn_mut")] #[lang = "async_fn_mut"]
pub trait AsyncFnMut<Args: Tuple>: AsyncFnOnce<Args> { pub trait AsyncFnMut<Args: Tuple>: AsyncFnOnce<Args> {
/// Future returned by [`AsyncFnMut::async_call_mut`]. /// Future returned by [`AsyncFnMut::async_call_mut`].
#[unstable(feature = "async_fn_traits", issue = "none")] #[unstable(feature = "async_fn_traits", issue = "none")]
@ -48,7 +48,7 @@ pub trait AsyncFnMut<Args: Tuple>: AsyncFnOnce<Args> {
#[rustc_paren_sugar] #[rustc_paren_sugar]
#[fundamental] #[fundamental]
#[must_use = "async closures are lazy and do nothing unless called"] #[must_use = "async closures are lazy and do nothing unless called"]
#[cfg_attr(not(bootstrap), lang = "async_fn_once")] #[lang = "async_fn_once"]
pub trait AsyncFnOnce<Args: Tuple> { pub trait AsyncFnOnce<Args: Tuple> {
/// Future returned by [`AsyncFnOnce::async_call_once`]. /// Future returned by [`AsyncFnOnce::async_call_once`].
#[unstable(feature = "async_fn_traits", issue = "none")] #[unstable(feature = "async_fn_traits", issue = "none")]

View file

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

View file

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

View file

@ -1951,10 +1951,7 @@ impl<T> [T] {
/// } /// }
/// ``` /// ```
#[unstable(feature = "slice_split_at_unchecked", reason = "new API", issue = "76014")] #[unstable(feature = "slice_split_at_unchecked", reason = "new API", issue = "76014")]
#[rustc_const_stable( #[rustc_const_stable(feature = "const_slice_split_at_unchecked", since = "1.77.0")]
feature = "const_slice_split_at_unchecked",
since = "1.77.0"
)]
#[inline] #[inline]
#[must_use] #[must_use]
pub const unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T]) { pub const unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T]) {

View file

@ -61,14 +61,6 @@ macro_rules! tuple_impls {
{} {}
} }
maybe_tuple_doc! {
$($T)+ @
#[unstable(feature = "structural_match", issue = "31434")]
#[cfg(bootstrap)]
impl<$($T),+> crate::marker::StructuralEq for ($($T,)+)
{}
}
maybe_tuple_doc! { maybe_tuple_doc! {
$($T)+ @ $($T)+ @
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]

View file

@ -59,7 +59,7 @@
#![feature(noop_waker)] #![feature(noop_waker)]
#![feature(numfmt)] #![feature(numfmt)]
#![feature(num_midpoint)] #![feature(num_midpoint)]
#![cfg_attr(not(bootstrap), feature(offset_of_nested))] #![feature(offset_of_nested)]
#![feature(isqrt)] #![feature(isqrt)]
#![feature(step_trait)] #![feature(step_trait)]
#![feature(str_internals)] #![feature(str_internals)]
@ -112,7 +112,7 @@
#![feature(slice_flatten)] #![feature(slice_flatten)]
#![feature(error_generic_member_access)] #![feature(error_generic_member_access)]
#![feature(error_in_core)] #![feature(error_in_core)]
#![cfg_attr(not(bootstrap), feature(trait_upcasting))] #![feature(trait_upcasting)]
#![feature(utf8_chunks)] #![feature(utf8_chunks)]
#![feature(is_ascii_octdigit)] #![feature(is_ascii_octdigit)]
#![feature(get_many_mut)] #![feature(get_many_mut)]

View file

@ -262,7 +262,7 @@ cfg_if::cfg_if! {
} }
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint // FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint
#[cfg_attr(not(bootstrap), allow(static_mut_ref))] #[allow(static_mut_ref)]
pub unsafe fn panic(data: Box<dyn Any + Send>) -> u32 { pub unsafe fn panic(data: Box<dyn Any + Send>) -> u32 {
use core::intrinsics::atomic_store_seqcst; use core::intrinsics::atomic_store_seqcst;
@ -325,7 +325,7 @@ pub unsafe fn panic(data: Box<dyn Any + Send>) -> u32 {
} }
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint // FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint
#[cfg_attr(not(bootstrap), allow(static_mut_ref))] #[allow(static_mut_ref)]
pub unsafe fn cleanup(payload: *mut u8) -> Box<dyn Any + Send> { pub unsafe fn cleanup(payload: *mut u8) -> Box<dyn Any + Send> {
// A null payload here means that we got here from the catch (...) of // A null payload here means that we got here from the catch (...) of
// __rust_try. This happens when a non-Rust foreign exception is caught. // __rust_try. This happens when a non-Rust foreign exception is caught.

View file

@ -266,12 +266,12 @@
// //
// Language features: // Language features:
// tidy-alphabetical-start // tidy-alphabetical-start
#![cfg_attr(not(bootstrap), feature(cfg_sanitizer_cfi))]
#![feature(alloc_error_handler)] #![feature(alloc_error_handler)]
#![feature(allocator_internals)] #![feature(allocator_internals)]
#![feature(allow_internal_unsafe)] #![feature(allow_internal_unsafe)]
#![feature(allow_internal_unstable)] #![feature(allow_internal_unstable)]
#![feature(c_unwind)] #![feature(c_unwind)]
#![feature(cfg_sanitizer_cfi)]
#![feature(cfg_target_thread_local)] #![feature(cfg_target_thread_local)]
#![feature(cfi_encoding)] #![feature(cfi_encoding)]
#![feature(concat_idents)] #![feature(concat_idents)]

View file

@ -338,7 +338,7 @@ pub mod panic_count {
#[cfg(not(feature = "panic_immediate_abort"))] #[cfg(not(feature = "panic_immediate_abort"))]
#[unstable(feature = "update_panic_count", issue = "none")] #[unstable(feature = "update_panic_count", issue = "none")]
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint // FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint
#[cfg_attr(not(bootstrap), allow(static_mut_ref))] #[allow(static_mut_ref)]
pub mod panic_count { pub mod panic_count {
use crate::cell::Cell; use crate::cell::Cell;
use crate::sync::atomic::{AtomicUsize, Ordering}; use crate::sync::atomic::{AtomicUsize, Ordering};

View file

@ -14,7 +14,7 @@ pub macro thread_local_inner {
#[inline] #[inline]
#[deny(unsafe_op_in_unsafe_fn)] #[deny(unsafe_op_in_unsafe_fn)]
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint // FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint
#[cfg_attr(not(bootstrap), allow(static_mut_ref))] #[allow(static_mut_ref)]
unsafe fn __getit( unsafe fn __getit(
_init: $crate::option::Option<&mut $crate::option::Option<$t>>, _init: $crate::option::Option<&mut $crate::option::Option<$t>>,
) -> $crate::option::Option<&'static $t> { ) -> $crate::option::Option<&'static $t> {

View file

@ -12,7 +12,7 @@ pub macro thread_local_inner {
#[inline] // see comments below #[inline] // see comments below
#[deny(unsafe_op_in_unsafe_fn)] #[deny(unsafe_op_in_unsafe_fn)]
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint // FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint
#[cfg_attr(not(bootstrap), allow(static_mut_ref))] #[allow(static_mut_ref)]
unsafe fn __getit( unsafe fn __getit(
_init: $crate::option::Option<&mut $crate::option::Option<$t>>, _init: $crate::option::Option<&mut $crate::option::Option<$t>>,
) -> $crate::option::Option<&'static $t> { ) -> $crate::option::Option<&'static $t> {

View file

@ -11,7 +11,6 @@
// Note, however, that we run on lots older linuxes, as well as cross // Note, however, that we run on lots older linuxes, as well as cross
// compiling from a newer linux to an older linux, so we also have a // compiling from a newer linux to an older linux, so we also have a
// fallback implementation to use as well. // fallback implementation to use as well.
#[cfg_attr(bootstrap, allow(unexpected_cfgs))]
#[cfg(any( #[cfg(any(
target_os = "linux", target_os = "linux",
target_os = "android", target_os = "android",

View file

@ -181,7 +181,7 @@ impl<T: 'static> fmt::Debug for LocalKey<T> {
#[cfg_attr(not(test), rustc_diagnostic_item = "thread_local_macro")] #[cfg_attr(not(test), rustc_diagnostic_item = "thread_local_macro")]
#[allow_internal_unstable(thread_local_internals)] #[allow_internal_unstable(thread_local_internals)]
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint // FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint
#[cfg_attr(not(bootstrap), allow(static_mut_ref))] #[allow(static_mut_ref)]
macro_rules! thread_local { macro_rules! thread_local {
// empty (base case for the recursion) // empty (base case for the recursion)
() => {}; () => {};

View file

@ -90,10 +90,6 @@ const EXTRA_CHECK_CFGS: &[(Option<Mode>, &str, Option<&[&'static str]>)] = &[
/* Extra values not defined in the built-in targets yet, but used in std */ /* Extra values not defined in the built-in targets yet, but used in std */
(Some(Mode::Std), "target_env", Some(&["libnx"])), (Some(Mode::Std), "target_env", Some(&["libnx"])),
// (Some(Mode::Std), "target_os", Some(&[])), // (Some(Mode::Std), "target_os", Some(&[])),
// #[cfg(bootstrap)] zkvm
(Some(Mode::Std), "target_os", Some(&["zkvm"])),
// #[cfg(bootstrap)] risc0
(Some(Mode::Std), "target_vendor", Some(&["risc0"])),
(Some(Mode::Std), "target_arch", Some(&["spirv", "nvptx", "xtensa"])), (Some(Mode::Std), "target_arch", Some(&["spirv", "nvptx", "xtensa"])),
/* Extra names used by dependencies */ /* Extra names used by dependencies */
// FIXME: Used by serde_json, but we should not be triggering on external dependencies. // FIXME: Used by serde_json, but we should not be triggering on external dependencies.

View file

@ -219,7 +219,7 @@ impl CovTerm {
enum MappingKind { enum MappingKind {
Code(CovTerm), Code(CovTerm),
Gap(CovTerm), Gap(CovTerm),
Expansion(u32), Expansion(#[allow(dead_code)] u32),
Skip, Skip,
// Using raw identifiers here makes the dump output a little bit nicer // Using raw identifiers here makes the dump output a little bit nicer
// (via the derived Debug), at the expense of making this tool's source // (via the derived Debug), at the expense of making this tool's source

View file

@ -10,7 +10,7 @@
#![feature(nonzero_ops)] #![feature(nonzero_ops)]
#![feature(let_chains)] #![feature(let_chains)]
#![feature(lint_reasons)] #![feature(lint_reasons)]
#![cfg_attr(not(bootstrap), feature(trait_upcasting))] #![feature(trait_upcasting)]
// Configure clippy and other lints // Configure clippy and other lints
#![allow( #![allow(
clippy::collapsible_else_if, clippy::collapsible_else_if,