about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2023-07-12 21:38:55 -0400
committerMark Rousskov <mark.simulacrum@gmail.com>2023-07-12 21:38:55 -0400
commit67b0cfc761c9ad31a1dbacca36c42803b255f17a (patch)
treea4674d84c64a62f308cbc98d4bcb8d21f5ae29d1
parent7559d96be9e6af26aa7e241ae1e98d277fb8b328 (diff)
downloadrust-67b0cfc761c9ad31a1dbacca36c42803b255f17a.tar.gz
rust-67b0cfc761c9ad31a1dbacca36c42803b255f17a.zip
Flip cfg's for bootstrap bump
-rw-r--r--compiler/rustc_ast/src/token.rs2
-rw-r--r--compiler/rustc_middle/src/ty/mod.rs2
-rw-r--r--compiler/rustc_trait_selection/src/traits/mod.rs4
-rw-r--r--library/alloc/src/alloc.rs21
-rw-r--r--library/alloc/tests/str.rs2
-rw-r--r--library/core/src/any.rs3
-rw-r--r--library/core/src/intrinsics.rs17
-rw-r--r--library/core/src/iter/adapters/flatten.rs7
-rw-r--r--library/core/src/marker.rs19
-rw-r--r--library/core/src/mem/transmutability.rs3
-rw-r--r--library/core/src/ptr/metadata.rs3
-rw-r--r--library/core/src/ptr/unique.rs2
-rw-r--r--library/core/src/tuple.rs2
-rw-r--r--library/core/tests/manually_drop.rs2
14 files changed, 16 insertions, 73 deletions
diff --git a/compiler/rustc_ast/src/token.rs b/compiler/rustc_ast/src/token.rs
index 6646fa9446f..303bdd3a307 100644
--- a/compiler/rustc_ast/src/token.rs
+++ b/compiler/rustc_ast/src/token.rs
@@ -11,7 +11,7 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
 use rustc_data_structures::sync::Lrc;
 use rustc_macros::HashStable_Generic;
 use rustc_span::symbol::{kw, sym};
-#[cfg_attr(not(bootstrap), allow(hidden_glob_reexports))]
+#[allow(hidden_glob_reexports)]
 use rustc_span::symbol::{Ident, Symbol};
 use rustc_span::{self, edition::Edition, Span, DUMMY_SP};
 use std::borrow::Cow;
diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs
index 519bdb01623..638e1efa65c 100644
--- a/compiler/rustc_middle/src/ty/mod.rs
+++ b/compiler/rustc_middle/src/ty/mod.rs
@@ -149,7 +149,7 @@ mod opaque_types;
 mod parameterized;
 mod rvalue_scopes;
 mod structural_impls;
-#[cfg_attr(not(bootstrap), allow(hidden_glob_reexports))]
+#[allow(hidden_glob_reexports)]
 mod sty;
 mod typeck_results;
 
diff --git a/compiler/rustc_trait_selection/src/traits/mod.rs b/compiler/rustc_trait_selection/src/traits/mod.rs
index 1af8323b6e9..bc136695442 100644
--- a/compiler/rustc_trait_selection/src/traits/mod.rs
+++ b/compiler/rustc_trait_selection/src/traits/mod.rs
@@ -13,12 +13,12 @@ mod object_safety;
 pub mod outlives_bounds;
 pub mod project;
 pub mod query;
-#[cfg_attr(not(bootstrap), allow(hidden_glob_reexports))]
+#[allow(hidden_glob_reexports)]
 mod select;
 mod specialize;
 mod structural_match;
 mod structural_normalize;
-#[cfg_attr(not(bootstrap), allow(hidden_glob_reexports))]
+#[allow(hidden_glob_reexports)]
 mod util;
 pub mod vtable;
 pub mod wf;
diff --git a/library/alloc/src/alloc.rs b/library/alloc/src/alloc.rs
index e24a0fe51bd..c8751ba4911 100644
--- a/library/alloc/src/alloc.rs
+++ b/library/alloc/src/alloc.rs
@@ -4,11 +4,7 @@
 
 #[cfg(not(test))]
 use core::intrinsics;
-#[cfg(all(bootstrap, not(test)))]
-use core::intrinsics::{min_align_of_val, size_of_val};
 
-#[cfg(all(bootstrap, not(test)))]
-use core::ptr::Unique;
 #[cfg(not(test))]
 use core::ptr::{self, NonNull};
 
@@ -337,23 +333,6 @@ unsafe fn exchange_malloc(size: usize, align: usize) -> *mut u8 {
     }
 }
 
-#[cfg(all(bootstrap, not(test)))]
-#[lang = "box_free"]
-#[inline]
-// This signature has to be the same as `Box`, otherwise an ICE will happen.
-// When an additional parameter to `Box` is added (like `A: Allocator`), this has to be added here as
-// well.
-// For example if `Box` is changed to  `struct Box<T: ?Sized, A: Allocator>(Unique<T>, A)`,
-// this function has to be changed to `fn box_free<T: ?Sized, A: Allocator>(Unique<T>, A)` as well.
-unsafe fn box_free<T: ?Sized, A: Allocator>(ptr: Unique<T>, alloc: A) {
-    unsafe {
-        let size = size_of_val(ptr.as_ref());
-        let align = min_align_of_val(ptr.as_ref());
-        let layout = Layout::from_size_align_unchecked(size, align);
-        alloc.deallocate(From::from(ptr.cast()), layout)
-    }
-}
-
 // # Allocation error handler
 
 #[cfg(not(no_global_oom_handling))]
diff --git a/library/alloc/tests/str.rs b/library/alloc/tests/str.rs
index 0ba5d088f61..82c1a9f9ad7 100644
--- a/library/alloc/tests/str.rs
+++ b/library/alloc/tests/str.rs
@@ -1,4 +1,4 @@
-#![cfg_attr(not(bootstrap), allow(invalid_from_utf8))]
+#![allow(invalid_from_utf8)]
 
 use std::assert_matches::assert_matches;
 use std::borrow::Cow;
diff --git a/library/core/src/any.rs b/library/core/src/any.rs
index 09f52d692d0..277c2f76a08 100644
--- a/library/core/src/any.rs
+++ b/library/core/src/any.rs
@@ -697,9 +697,6 @@ impl TypeId {
     #[stable(feature = "rust1", since = "1.0.0")]
     #[rustc_const_unstable(feature = "const_type_id", issue = "77125")]
     pub const fn of<T: ?Sized + 'static>() -> TypeId {
-        #[cfg(bootstrap)]
-        let t = intrinsics::type_id::<T>() as u128;
-        #[cfg(not(bootstrap))]
         let t: u128 = intrinsics::type_id::<T>();
         TypeId { t }
     }
diff --git a/library/core/src/intrinsics.rs b/library/core/src/intrinsics.rs
index 5a9a7013a19..deef68e4699 100644
--- a/library/core/src/intrinsics.rs
+++ b/library/core/src/intrinsics.rs
@@ -1057,23 +1057,6 @@ extern "rust-intrinsic" {
     #[rustc_const_unstable(feature = "const_type_id", issue = "77125")]
     #[rustc_safe_intrinsic]
     #[rustc_nounwind]
-    #[cfg(bootstrap)]
-    pub fn type_id<T: ?Sized + 'static>() -> u64;
-
-    /// Gets an identifier which is globally unique to the specified type. This
-    /// function will return the same value for a type regardless of whichever
-    /// crate it is invoked in.
-    ///
-    /// Note that, unlike most intrinsics, this is safe to call;
-    /// it does not require an `unsafe` block.
-    /// Therefore, implementations must not require the user to uphold
-    /// any safety invariants.
-    ///
-    /// The stabilized version of this intrinsic is [`core::any::TypeId::of`].
-    #[rustc_const_unstable(feature = "const_type_id", issue = "77125")]
-    #[rustc_safe_intrinsic]
-    #[rustc_nounwind]
-    #[cfg(not(bootstrap))]
     pub fn type_id<T: ?Sized + 'static>() -> u128;
 
     /// A guard for unsafe functions that cannot ever be executed if `T` is uninhabited:
diff --git a/library/core/src/iter/adapters/flatten.rs b/library/core/src/iter/adapters/flatten.rs
index d3e45456351..eee6e5bccec 100644
--- a/library/core/src/iter/adapters/flatten.rs
+++ b/library/core/src/iter/adapters/flatten.rs
@@ -310,7 +310,7 @@ where
 /// Real logic of both `Flatten` and `FlatMap` which simply delegate to
 /// this type.
 #[derive(Clone, Debug)]
-#[cfg_attr(bootstrap, unstable(feature = "trusted_len", issue = "37572"))]
+#[unstable(feature = "trusted_len", issue = "37572")]
 struct FlattenCompat<I, U> {
     iter: Fuse<I>,
     frontiter: Option<U>,
@@ -464,7 +464,6 @@ where
     }
 }
 
-#[cfg_attr(bootstrap, unstable(feature = "trusted_len", issue = "37572"))]
 impl<I, U> Iterator for FlattenCompat<I, U>
 where
     I: Iterator<Item: IntoIterator<IntoIter = U, Item = U::Item>>,
@@ -579,7 +578,6 @@ where
     }
 }
 
-#[cfg_attr(bootstrap, unstable(feature = "trusted_len", issue = "37572"))]
 impl<I, U> DoubleEndedIterator for FlattenCompat<I, U>
 where
     I: DoubleEndedIterator<Item: IntoIterator<IntoIter = U, Item = U::Item>>,
@@ -649,7 +647,6 @@ where
     }
 }
 
-#[cfg_attr(bootstrap, unstable(feature = "trusted_len", issue = "37572"))]
 unsafe impl<const N: usize, I, T> TrustedLen
     for FlattenCompat<I, <[T; N] as IntoIterator>::IntoIter>
 where
@@ -657,7 +654,6 @@ where
 {
 }
 
-#[cfg_attr(bootstrap, unstable(feature = "trusted_len", issue = "37572"))]
 unsafe impl<'a, const N: usize, I, T> TrustedLen
     for FlattenCompat<I, <&'a [T; N] as IntoIterator>::IntoIter>
 where
@@ -665,7 +661,6 @@ where
 {
 }
 
-#[cfg_attr(bootstrap, unstable(feature = "trusted_len", issue = "37572"))]
 unsafe impl<'a, const N: usize, I, T> TrustedLen
     for FlattenCompat<I, <&'a mut [T; N] as IntoIterator>::IntoIter>
 where
diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs
index e251015dd86..5ec751e5168 100644
--- a/library/core/src/marker.rs
+++ b/library/core/src/marker.rs
@@ -140,8 +140,7 @@ unsafe impl<T: Sync + ?Sized> Send for &T {}
 )]
 #[fundamental] // for Default, for example, which requires that `[T]: !Default` be evaluatable
 #[rustc_specialization_trait]
-#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl(implement_via_object = false))]
-#[cfg_attr(bootstrap, rustc_deny_explicit_impl)]
+#[rustc_deny_explicit_impl(implement_via_object = false)]
 #[rustc_coinductive]
 pub trait Sized {
     // Empty.
@@ -174,8 +173,7 @@ pub trait Sized {
 /// [nomicon-coerce]: ../../nomicon/coercions.html
 #[unstable(feature = "unsize", issue = "18598")]
 #[lang = "unsize"]
-#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl(implement_via_object = false))]
-#[cfg_attr(bootstrap, rustc_deny_explicit_impl)]
+#[rustc_deny_explicit_impl(implement_via_object = false)]
 pub trait Unsize<T: ?Sized> {
     // Empty.
 }
@@ -856,8 +854,7 @@ impl<T: ?Sized> StructuralEq for PhantomData<T> {}
     reason = "this trait is unlikely to ever be stabilized, use `mem::discriminant` instead"
 )]
 #[lang = "discriminant_kind"]
-#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl(implement_via_object = false))]
-#[cfg_attr(bootstrap, rustc_deny_explicit_impl)]
+#[rustc_deny_explicit_impl(implement_via_object = false)]
 pub trait DiscriminantKind {
     /// The type of the discriminant, which must satisfy the trait
     /// bounds required by `mem::Discriminant`.
@@ -962,8 +959,7 @@ marker_impls! {
 #[unstable(feature = "const_trait_impl", issue = "67792")]
 #[lang = "destruct"]
 #[rustc_on_unimplemented(message = "can't drop `{Self}`", append_const_msg)]
-#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl(implement_via_object = false))]
-#[cfg_attr(bootstrap, rustc_deny_explicit_impl)]
+#[rustc_deny_explicit_impl(implement_via_object = false)]
 #[const_trait]
 pub trait Destruct {}
 
@@ -974,8 +970,7 @@ pub trait Destruct {}
 #[unstable(feature = "tuple_trait", issue = "none")]
 #[lang = "tuple_trait"]
 #[rustc_on_unimplemented(message = "`{Self}` is not a tuple")]
-#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl(implement_via_object = false))]
-#[cfg_attr(bootstrap, rustc_deny_explicit_impl)]
+#[rustc_deny_explicit_impl(implement_via_object = false)]
 pub trait Tuple {}
 
 /// A marker for pointer-like types.
@@ -1020,7 +1015,6 @@ marker_impls! {
 
 // FIXME(adt_const_params): Add to marker_impls call above once not in bootstrap
 #[unstable(feature = "adt_const_params", issue = "95174")]
-#[cfg(not(bootstrap))]
 impl ConstParamTy for () {}
 
 /// A common trait implemented by all function pointers.
@@ -1030,8 +1024,7 @@ impl ConstParamTy for () {}
     reason = "internal trait for implementing various traits for all function pointers"
 )]
 #[lang = "fn_ptr_trait"]
-#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl(implement_via_object = false))]
-#[cfg_attr(bootstrap, rustc_deny_explicit_impl)]
+#[rustc_deny_explicit_impl(implement_via_object = false)]
 pub trait FnPtr: Copy + Clone {
     /// Returns the address of the function pointer.
     #[lang = "fn_ptr_addr"]
diff --git a/library/core/src/mem/transmutability.rs b/library/core/src/mem/transmutability.rs
index aed23119fd2..f5cc86e7767 100644
--- a/library/core/src/mem/transmutability.rs
+++ b/library/core/src/mem/transmutability.rs
@@ -7,8 +7,7 @@ use crate::marker::ConstParamTy;
 /// notwithstanding whatever safety checks you have asked the compiler to [`Assume`] are satisfied.
 #[unstable(feature = "transmutability", issue = "99571")]
 #[lang = "transmute_trait"]
-#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl(implement_via_object = false))]
-#[cfg_attr(bootstrap, rustc_deny_explicit_impl)]
+#[rustc_deny_explicit_impl(implement_via_object = false)]
 #[rustc_coinductive]
 pub unsafe trait BikeshedIntrinsicFrom<Src, Context, const ASSUME: Assume = { Assume::NOTHING }>
 where
diff --git a/library/core/src/ptr/metadata.rs b/library/core/src/ptr/metadata.rs
index daaa44b1d9a..040aa069787 100644
--- a/library/core/src/ptr/metadata.rs
+++ b/library/core/src/ptr/metadata.rs
@@ -50,8 +50,7 @@ use crate::hash::{Hash, Hasher};
 ///
 /// [`to_raw_parts`]: *const::to_raw_parts
 #[lang = "pointee_trait"]
-#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl(implement_via_object = false))]
-#[cfg_attr(bootstrap, rustc_deny_explicit_impl)]
+#[rustc_deny_explicit_impl(implement_via_object = false)]
 pub trait Pointee {
     /// The type for metadata in pointers and references to `Self`.
     #[lang = "metadata_type"]
diff --git a/library/core/src/ptr/unique.rs b/library/core/src/ptr/unique.rs
index ff7e91d3ec3..bf8b86677d5 100644
--- a/library/core/src/ptr/unique.rs
+++ b/library/core/src/ptr/unique.rs
@@ -33,7 +33,7 @@ use crate::ptr::NonNull;
 #[doc(hidden)]
 #[repr(transparent)]
 // Lang item used experimentally by Miri to define the semantics of `Unique`.
-#[cfg_attr(not(bootstrap), lang = "ptr_unique")]
+#[lang = "ptr_unique"]
 pub struct Unique<T: ?Sized> {
     pointer: NonNull<T>,
     // NOTE: this marker has no consequences for variance, but is necessary
diff --git a/library/core/src/tuple.rs b/library/core/src/tuple.rs
index ac8d04a8286..7782ace69c1 100644
--- a/library/core/src/tuple.rs
+++ b/library/core/src/tuple.rs
@@ -1,7 +1,6 @@
 // See src/libstd/primitive_docs.rs for documentation.
 
 use crate::cmp::Ordering::{self, *};
-#[cfg(not(bootstrap))]
 use crate::marker::ConstParamTy;
 use crate::marker::{StructuralEq, StructuralPartialEq};
 
@@ -51,7 +50,6 @@ macro_rules! tuple_impls {
         maybe_tuple_doc! {
             $($T)+ @
             #[unstable(feature = "structural_match", issue = "31434")]
-            #[cfg(not(bootstrap))]
             impl<$($T: ConstParamTy),+> ConstParamTy for ($($T,)+)
             {}
         }
diff --git a/library/core/tests/manually_drop.rs b/library/core/tests/manually_drop.rs
index 22d72d219a7..bbf444471ad 100644
--- a/library/core/tests/manually_drop.rs
+++ b/library/core/tests/manually_drop.rs
@@ -1,4 +1,4 @@
-#![cfg_attr(not(bootstrap), allow(undropped_manually_drops))]
+#![allow(undropped_manually_drops)]
 
 use core::mem::ManuallyDrop;