diff --git a/compiler/rustc_borrowck/src/lib.rs b/compiler/rustc_borrowck/src/lib.rs index 08df87e0488..c4fc7e0df00 100644 --- a/compiler/rustc_borrowck/src/lib.rs +++ b/compiler/rustc_borrowck/src/lib.rs @@ -2,7 +2,6 @@ #![feature(bool_to_option)] #![feature(box_patterns)] -#![cfg_attr(bootstrap, feature(const_panic))] #![feature(crate_visibility_modifier)] #![feature(format_args_capture)] #![feature(in_band_lifetimes)] diff --git a/compiler/rustc_data_structures/src/lib.rs b/compiler/rustc_data_structures/src/lib.rs index 94e115ed498..77784bf1705 100644 --- a/compiler/rustc_data_structures/src/lib.rs +++ b/compiler/rustc_data_structures/src/lib.rs @@ -11,7 +11,6 @@ #![feature(associated_type_bounds)] #![feature(auto_traits)] #![feature(bool_to_option)] -#![cfg_attr(bootstrap, feature(const_panic))] #![feature(control_flow_enum)] #![feature(core_intrinsics)] #![feature(extend_one)] diff --git a/compiler/rustc_index/src/vec.rs b/compiler/rustc_index/src/vec.rs index 66399d29998..45639bad243 100644 --- a/compiler/rustc_index/src/vec.rs +++ b/compiler/rustc_index/src/vec.rs @@ -124,10 +124,7 @@ impl $type { #[inline] $v const fn from_usize(value: usize) -> Self { - #[cfg(not(bootstrap))] assert!(value <= ($max as usize)); - #[cfg(bootstrap)] - [()][(value > ($max as usize)) as usize]; unsafe { Self::from_u32_unchecked(value as u32) } @@ -135,10 +132,7 @@ impl $type { #[inline] $v const fn from_u32(value: u32) -> Self { - #[cfg(not(bootstrap))] assert!(value <= $max); - #[cfg(bootstrap)] - [()][(value > $max) as usize]; unsafe { Self::from_u32_unchecked(value) } diff --git a/compiler/rustc_mir_dataflow/src/lib.rs b/compiler/rustc_mir_dataflow/src/lib.rs index 2f3de52965d..77a72ce63ce 100644 --- a/compiler/rustc_mir_dataflow/src/lib.rs +++ b/compiler/rustc_mir_dataflow/src/lib.rs @@ -2,7 +2,6 @@ #![feature(bool_to_option)] #![feature(box_patterns)] #![feature(box_syntax)] -#![cfg_attr(bootstrap, feature(const_panic))] #![feature(exact_size_is_empty)] #![feature(in_band_lifetimes)] #![feature(iter_zip)] diff --git a/compiler/rustc_mir_transform/src/lib.rs b/compiler/rustc_mir_transform/src/lib.rs index 8638cbac049..3df4ece39f0 100644 --- a/compiler/rustc_mir_transform/src/lib.rs +++ b/compiler/rustc_mir_transform/src/lib.rs @@ -1,7 +1,6 @@ #![feature(box_patterns)] #![feature(box_syntax)] #![feature(crate_visibility_modifier)] -#![cfg_attr(bootstrap, feature(const_panic))] #![feature(in_band_lifetimes)] #![feature(iter_zip)] #![feature(let_else)] diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs index 285d7755c06..5e6fe3b9b32 100644 --- a/library/alloc/src/lib.rs +++ b/library/alloc/src/lib.rs @@ -156,7 +156,7 @@ // // Rustdoc features: #![feature(doc_cfg)] -#![cfg_attr(not(bootstrap), feature(doc_cfg_hide))] +#![feature(doc_cfg_hide)] // Technically, this is a bug in rustdoc: rustdoc sees the documentation on `#[lang = slice_alloc]` // blocks is for `&[T]`, which also has documentation using this feature in `core`, and gets mad // that the feature-gate isn't enabled. Ideally, it wouldn't check for the feature gate for docs diff --git a/library/core/src/clone.rs b/library/core/src/clone.rs index b02333b0288..281ff3badfb 100644 --- a/library/core/src/clone.rs +++ b/library/core/src/clone.rs @@ -105,7 +105,7 @@ #[stable(feature = "rust1", since = "1.0.0")] #[lang = "clone"] #[rustc_diagnostic_item = "Clone"] -#[cfg_attr(not(bootstrap), rustc_trivial_field_reads)] +#[rustc_trivial_field_reads] pub trait Clone: Sized { /// Returns a copy of the value. /// diff --git a/library/core/src/fmt/mod.rs b/library/core/src/fmt/mod.rs index b8ad7720e0c..9258b4d0818 100644 --- a/library/core/src/fmt/mod.rs +++ b/library/core/src/fmt/mod.rs @@ -374,7 +374,6 @@ pub const fn new_v1(pieces: &'a [&'static str], args: &'a [ArgumentV1<'a>]) -> A /// valid index of `args`. /// 3. Every [`Count::Param`] within `fmt` must contain a valid index of /// `args`. - #[cfg(not(bootstrap))] #[doc(hidden)] #[inline] #[unstable(feature = "fmt_internals", reason = "internal to format_args!", issue = "none")] @@ -388,19 +387,6 @@ pub const fn new_v1_formatted( Arguments { pieces, fmt: Some(fmt), args } } - #[cfg(bootstrap)] - #[doc(hidden)] - #[inline] - #[unstable(feature = "fmt_internals", reason = "internal to format_args!", issue = "none")] - #[rustc_const_unstable(feature = "const_fmt_arguments_new", issue = "none")] - pub const unsafe fn new_v1_formatted( - pieces: &'a [&'static str], - args: &'a [ArgumentV1<'a>], - fmt: &'a [rt::v1::Argument], - ) -> Arguments<'a> { - Arguments { pieces, fmt: Some(fmt), args } - } - /// Estimates the length of the formatted text. /// /// This is intended to be used for setting initial `String` capacity @@ -619,7 +605,7 @@ fn fmt(&self, fmt: &mut Formatter<'_>) -> Result { )] #[doc(alias = "{:?}")] #[rustc_diagnostic_item = "Debug"] -#[cfg_attr(not(bootstrap), rustc_trivial_field_reads)] +#[rustc_trivial_field_reads] pub trait Debug { /// Formats the value using the given formatter. /// diff --git a/library/core/src/intrinsics.rs b/library/core/src/intrinsics.rs index 1aeb83931e5..91230c027c2 100644 --- a/library/core/src/intrinsics.rs +++ b/library/core/src/intrinsics.rs @@ -2252,7 +2252,6 @@ pub unsafe fn write_bytes(dst: *mut T, val: u8, count: usize) { /// or have any other observable side-effects, the behavior is undefined. /// /// [referential transparency]: https://en.wikipedia.org/wiki/Referential_transparency -#[cfg(not(bootstrap))] #[unstable( feature = "const_eval_select", issue = "none", @@ -2273,7 +2272,6 @@ pub unsafe fn write_bytes(dst: *mut T, val: u8, count: usize) { called_at_rt.call_once(arg) } -#[cfg(not(bootstrap))] #[unstable( feature = "const_eval_select", issue = "none", diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 58a170401e7..bc6173b7ffa 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -150,7 +150,6 @@ #![feature(const_fn_trait_bound)] #![feature(const_impl_trait)] #![feature(const_mut_refs)] -#![cfg_attr(bootstrap, feature(const_panic))] #![feature(const_precise_live_drops)] #![feature(const_raw_ptr_deref)] #![feature(const_refs_to_cell)] @@ -159,7 +158,7 @@ #![feature(doc_notable_trait)] #![feature(doc_primitive)] #![feature(exhaustive_patterns)] -#![cfg_attr(not(bootstrap), feature(doc_cfg_hide))] +#![feature(doc_cfg_hide)] #![feature(extern_types)] #![feature(fundamental)] #![feature(if_let_guard)] @@ -170,7 +169,7 @@ #![feature(llvm_asm)] #![feature(min_specialization)] #![feature(mixed_integer_ops)] -#![cfg_attr(not(bootstrap), feature(must_not_suspend))] +#![feature(must_not_suspend)] #![feature(negative_impls)] #![feature(never_type)] #![feature(no_core)] diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs index e5c3fafe5f1..37446bafacb 100644 --- a/library/core/src/marker.rs +++ b/library/core/src/marker.rs @@ -30,8 +30,7 @@ /// [arc]: ../../std/sync/struct.Arc.html /// [ub]: ../../reference/behavior-considered-undefined.html #[stable(feature = "rust1", since = "1.0.0")] -#[cfg_attr(all(not(test), bootstrap), rustc_diagnostic_item = "send_trait")] -#[cfg_attr(all(not(test), not(bootstrap)), rustc_diagnostic_item = "Send")] +#[cfg_attr(not(test), rustc_diagnostic_item = "Send")] #[rustc_on_unimplemented( message = "`{Self}` cannot be sent between threads safely", label = "`{Self}` cannot be sent between threads safely" diff --git a/library/core/src/panicking.rs b/library/core/src/panicking.rs index a12447acf7e..087d2348ace 100644 --- a/library/core/src/panicking.rs +++ b/library/core/src/panicking.rs @@ -59,7 +59,7 @@ pub fn panic_str(expr: &str) -> ! { #[inline] #[track_caller] -#[cfg_attr(not(bootstrap), lang = "panic_display")] // needed for const-evaluated panics +#[lang = "panic_display"] // needed for const-evaluated panics pub fn panic_display(x: &T) -> ! { panic_fmt(format_args!("{}", *x)); } diff --git a/library/core/tests/lib.rs b/library/core/tests/lib.rs index 507a79c3de1..1948844e1fd 100644 --- a/library/core/tests/lib.rs +++ b/library/core/tests/lib.rs @@ -11,7 +11,6 @@ #![feature(const_cell_into_inner)] #![feature(const_convert)] #![feature(const_maybe_uninit_assume_init)] -#![cfg_attr(bootstrap, feature(const_panic))] #![feature(const_ptr_read)] #![feature(const_ptr_write)] #![feature(const_ptr_offset)] diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index e22748a4c8d..335e0e072f3 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -272,7 +272,7 @@ #![feature(custom_test_frameworks)] #![feature(decl_macro)] #![feature(doc_cfg)] -#![cfg_attr(not(bootstrap), feature(doc_cfg_hide))] +#![feature(doc_cfg_hide)] #![feature(doc_keyword)] #![feature(doc_masked)] #![feature(doc_notable_trait)] @@ -308,7 +308,7 @@ #![feature(maybe_uninit_uninit_array)] #![feature(min_specialization)] #![feature(mixed_integer_ops)] -#![cfg_attr(not(bootstrap), feature(must_not_suspend))] +#![feature(must_not_suspend)] #![feature(needs_panic_runtime)] #![feature(negative_impls)] #![feature(never_type)]