From 32bae1353ebfc89e0b7ad1cc9c2ad6a0482a5c1d Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 5 Mar 2026 14:56:04 -0800 Subject: [PATCH] Update cfg(bootstrap) --- compiler/rustc_abi/src/lib.rs | 1 - compiler/rustc_ast/src/lib.rs | 1 - compiler/rustc_ast/src/visit.rs | 3 +-- compiler/rustc_ast_lowering/src/lib.rs | 1 - compiler/rustc_ast_passes/src/lib.rs | 1 - compiler/rustc_attr_parsing/src/lib.rs | 1 - compiler/rustc_borrowck/src/lib.rs | 2 -- compiler/rustc_builtin_macros/src/lib.rs | 2 -- compiler/rustc_codegen_llvm/src/lib.rs | 2 -- compiler/rustc_codegen_ssa/src/lib.rs | 2 -- compiler/rustc_const_eval/src/lib.rs | 2 -- compiler/rustc_data_structures/src/lib.rs | 6 ------ compiler/rustc_errors/src/lib.rs | 1 - compiler/rustc_expand/src/lib.rs | 1 - compiler/rustc_hir_analysis/src/lib.rs | 2 -- compiler/rustc_hir_typeck/src/lib.rs | 2 -- compiler/rustc_infer/src/lib.rs | 1 - compiler/rustc_lint/src/lib.rs | 2 -- compiler/rustc_lint_defs/src/builtin.rs | 1 - compiler/rustc_macros/src/query.rs | 3 +-- compiler/rustc_metadata/src/lib.rs | 1 - compiler/rustc_middle/src/lib.rs | 2 -- compiler/rustc_mir_build/src/lib.rs | 2 -- compiler/rustc_mir_dataflow/src/lib.rs | 1 - compiler/rustc_mir_transform/src/check_alignment.rs | 1 - compiler/rustc_mir_transform/src/gvn.rs | 3 +-- compiler/rustc_mir_transform/src/lib.rs | 2 -- compiler/rustc_monomorphize/src/lib.rs | 1 - compiler/rustc_parse/src/lib.rs | 2 -- compiler/rustc_resolve/src/lib.rs | 3 --- compiler/rustc_span/src/lib.rs | 2 -- compiler/rustc_symbol_mangling/src/lib.rs | 4 ---- compiler/rustc_trait_selection/src/lib.rs | 2 -- compiler/rustc_ty_utils/src/lib.rs | 2 -- src/librustdoc/clean/utils.rs | 3 --- src/librustdoc/lib.rs | 2 -- src/tools/clippy/clippy_lints/src/lib.rs | 1 - src/tools/clippy/clippy_utils/src/lib.rs | 2 -- src/tools/clippy/clippy_utils/src/ty/mod.rs | 3 --- src/tools/miri/cargo-miri/src/setup.rs | 5 +---- src/tools/miri/src/lib.rs | 2 -- src/tools/miri/src/shims/foreign_items.rs | 1 - 42 files changed, 4 insertions(+), 80 deletions(-) diff --git a/compiler/rustc_abi/src/lib.rs b/compiler/rustc_abi/src/lib.rs index 59cc852d7a32..ce5f257abae9 100644 --- a/compiler/rustc_abi/src/lib.rs +++ b/compiler/rustc_abi/src/lib.rs @@ -1,5 +1,4 @@ // tidy-alphabetical-start -#![cfg_attr(all(feature = "nightly", bootstrap, test), feature(assert_matches))] #![cfg_attr(feature = "nightly", allow(internal_features))] #![cfg_attr(feature = "nightly", feature(rustc_attrs))] #![cfg_attr(feature = "nightly", feature(step_trait))] diff --git a/compiler/rustc_ast/src/lib.rs b/compiler/rustc_ast/src/lib.rs index 3ae3a74d4598..ac3e77b0b5d6 100644 --- a/compiler/rustc_ast/src/lib.rs +++ b/compiler/rustc_ast/src/lib.rs @@ -5,7 +5,6 @@ //! This API is completely unstable and subject to change. // tidy-alphabetical-start -#![cfg_attr(bootstrap, feature(if_let_guard))] #![doc(test(attr(deny(warnings), allow(internal_features))))] #![feature(associated_type_defaults)] #![feature(box_patterns)] diff --git a/compiler/rustc_ast/src/visit.rs b/compiler/rustc_ast/src/visit.rs index e7b492a9c1db..c3c1c518d849 100644 --- a/compiler/rustc_ast/src/visit.rs +++ b/compiler/rustc_ast/src/visit.rs @@ -762,8 +762,7 @@ fn walk<$($lt,)? V: $Visitor$(<$lt>)?>( // This is only used by the MutVisitor. We include this symmetry here to make writing other // functions easier. $(${ignore($lt)} - #[cfg_attr(not(bootstrap), expect(unused, rustc::disallowed_pass_by_ref))] - #[cfg_attr(bootstrap, expect(unused, rustc::pass_by_value))] + #[expect(unused, rustc::disallowed_pass_by_ref)] #[inline] )? fn visit_span<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, span: &$($lt)? $($mut)? Span) -> V::Result { diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index 5c293b82a420..05af797c9b5d 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -31,7 +31,6 @@ //! in the HIR, especially for multiple identifiers. // tidy-alphabetical-start -#![cfg_attr(bootstrap, feature(if_let_guard))] #![feature(box_patterns)] #![recursion_limit = "256"] // tidy-alphabetical-end diff --git a/compiler/rustc_ast_passes/src/lib.rs b/compiler/rustc_ast_passes/src/lib.rs index 31761752c7f9..677e44a79ac4 100644 --- a/compiler/rustc_ast_passes/src/lib.rs +++ b/compiler/rustc_ast_passes/src/lib.rs @@ -3,7 +3,6 @@ //! by `rustc_ast_lowering`. // tidy-alphabetical-start -#![cfg_attr(bootstrap, feature(if_let_guard))] #![feature(box_patterns)] #![feature(iter_intersperse)] #![feature(iter_is_partitioned)] diff --git a/compiler/rustc_attr_parsing/src/lib.rs b/compiler/rustc_attr_parsing/src/lib.rs index 76afcb2a260a..db09572cc56b 100644 --- a/compiler/rustc_attr_parsing/src/lib.rs +++ b/compiler/rustc_attr_parsing/src/lib.rs @@ -77,7 +77,6 @@ //! containing both `C` and `packed` annotations. // tidy-alphabetical-start -#![cfg_attr(bootstrap, feature(if_let_guard))] #![feature(decl_macro)] #![feature(iter_intersperse)] #![recursion_limit = "256"] diff --git a/compiler/rustc_borrowck/src/lib.rs b/compiler/rustc_borrowck/src/lib.rs index bd46a40c02da..45517f27ff9f 100644 --- a/compiler/rustc_borrowck/src/lib.rs +++ b/compiler/rustc_borrowck/src/lib.rs @@ -2,8 +2,6 @@ // tidy-alphabetical-start #![allow(internal_features)] -#![cfg_attr(bootstrap, feature(assert_matches))] -#![cfg_attr(bootstrap, feature(if_let_guard))] #![feature(box_patterns)] #![feature(default_field_values)] #![feature(file_buffered)] diff --git a/compiler/rustc_builtin_macros/src/lib.rs b/compiler/rustc_builtin_macros/src/lib.rs index 9c4005c7f7f2..d39e3d810354 100644 --- a/compiler/rustc_builtin_macros/src/lib.rs +++ b/compiler/rustc_builtin_macros/src/lib.rs @@ -3,8 +3,6 @@ // tidy-alphabetical-start #![allow(internal_features)] -#![cfg_attr(bootstrap, feature(assert_matches))] -#![cfg_attr(bootstrap, feature(if_let_guard))] #![feature(box_patterns)] #![feature(decl_macro)] #![feature(iter_order_by)] diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs index 62bba6c9bfc2..17b6956ebd53 100644 --- a/compiler/rustc_codegen_llvm/src/lib.rs +++ b/compiler/rustc_codegen_llvm/src/lib.rs @@ -5,8 +5,6 @@ //! This API is completely unstable and subject to change. // tidy-alphabetical-start -#![cfg_attr(bootstrap, feature(assert_matches))] -#![cfg_attr(bootstrap, feature(if_let_guard))] #![feature(extern_types)] #![feature(file_buffered)] #![feature(impl_trait_in_assoc_type)] diff --git a/compiler/rustc_codegen_ssa/src/lib.rs b/compiler/rustc_codegen_ssa/src/lib.rs index 62914b82747c..ced4b59c4f0c 100644 --- a/compiler/rustc_codegen_ssa/src/lib.rs +++ b/compiler/rustc_codegen_ssa/src/lib.rs @@ -1,6 +1,4 @@ // tidy-alphabetical-start -#![cfg_attr(bootstrap, feature(assert_matches))] -#![cfg_attr(bootstrap, feature(if_let_guard))] #![feature(box_patterns)] #![feature(file_buffered)] #![feature(negative_impls)] diff --git a/compiler/rustc_const_eval/src/lib.rs b/compiler/rustc_const_eval/src/lib.rs index e57d719a67a4..ade6f1c09475 100644 --- a/compiler/rustc_const_eval/src/lib.rs +++ b/compiler/rustc_const_eval/src/lib.rs @@ -1,6 +1,4 @@ // tidy-alphabetical-start -#![cfg_attr(bootstrap, feature(assert_matches))] -#![cfg_attr(bootstrap, feature(if_let_guard))] #![feature(array_try_map)] #![feature(box_patterns)] #![feature(decl_macro)] diff --git a/compiler/rustc_data_structures/src/lib.rs b/compiler/rustc_data_structures/src/lib.rs index b01834aa80d9..82ae6664bf51 100644 --- a/compiler/rustc_data_structures/src/lib.rs +++ b/compiler/rustc_data_structures/src/lib.rs @@ -10,9 +10,6 @@ #![allow(internal_features)] #![allow(rustc::default_hash_types)] #![allow(rustc::potential_query_instability)] -#![cfg_attr(bootstrap, feature(assert_matches))] -#![cfg_attr(bootstrap, feature(cfg_select))] -#![cfg_attr(bootstrap, feature(cold_path))] #![cfg_attr(test, feature(test))] #![deny(unsafe_op_in_unsafe_fn)] #![feature(allocator_api)] @@ -41,10 +38,7 @@ // have to worry about it being moved to a different module in std during stabilization. // FIXME(#151359): Remove this when `feature(assert_matches)` is stable in stage0. // (This doesn't necessarily need to be fixed during the beta bump itself.) -#[cfg(bootstrap)] -pub use std::assert_matches::{assert_matches, debug_assert_matches}; use std::fmt; -#[cfg(not(bootstrap))] pub use std::{assert_matches, debug_assert_matches}; // This allows derive macros to reference this crate diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index f546cdeca762..379fac6c30c6 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -5,7 +5,6 @@ // tidy-alphabetical-start #![allow(internal_features)] #![allow(rustc::direct_use_of_rustc_type_ir)] -#![cfg_attr(bootstrap, feature(assert_matches))] #![feature(associated_type_defaults)] #![feature(default_field_values)] #![feature(macro_metavar_expr_concat)] diff --git a/compiler/rustc_expand/src/lib.rs b/compiler/rustc_expand/src/lib.rs index 5914fee8315d..d2ac7103bccb 100644 --- a/compiler/rustc_expand/src/lib.rs +++ b/compiler/rustc_expand/src/lib.rs @@ -1,6 +1,5 @@ // tidy-alphabetical-start #![allow(internal_features)] -#![cfg_attr(bootstrap, feature(if_let_guard))] #![feature(associated_type_defaults)] #![feature(macro_metavar_expr)] #![feature(proc_macro_diagnostic)] diff --git a/compiler/rustc_hir_analysis/src/lib.rs b/compiler/rustc_hir_analysis/src/lib.rs index 00b335fff3b4..2d8cbd0041d8 100644 --- a/compiler/rustc_hir_analysis/src/lib.rs +++ b/compiler/rustc_hir_analysis/src/lib.rs @@ -56,8 +56,6 @@ */ // tidy-alphabetical-start -#![cfg_attr(bootstrap, feature(assert_matches))] -#![cfg_attr(bootstrap, feature(if_let_guard))] #![feature(default_field_values)] #![feature(gen_blocks)] #![feature(iter_intersperse)] diff --git a/compiler/rustc_hir_typeck/src/lib.rs b/compiler/rustc_hir_typeck/src/lib.rs index 15e94a27d559..77c95fd55be3 100644 --- a/compiler/rustc_hir_typeck/src/lib.rs +++ b/compiler/rustc_hir_typeck/src/lib.rs @@ -1,6 +1,4 @@ // tidy-alphabetical-start -#![cfg_attr(bootstrap, feature(assert_matches))] -#![cfg_attr(bootstrap, feature(if_let_guard))] #![feature(box_patterns)] #![feature(iter_intersperse)] #![feature(iter_order_by)] diff --git a/compiler/rustc_infer/src/lib.rs b/compiler/rustc_infer/src/lib.rs index 008b5c94a5ea..2595c1a7b276 100644 --- a/compiler/rustc_infer/src/lib.rs +++ b/compiler/rustc_infer/src/lib.rs @@ -14,7 +14,6 @@ // tidy-alphabetical-start #![allow(rustc::direct_use_of_rustc_type_ir)] -#![cfg_attr(bootstrap, feature(assert_matches))] #![feature(extend_one)] #![recursion_limit = "512"] // For rustdoc // tidy-alphabetical-end diff --git a/compiler/rustc_lint/src/lib.rs b/compiler/rustc_lint/src/lib.rs index 194a8cfc2ea3..1790eac7bef5 100644 --- a/compiler/rustc_lint/src/lib.rs +++ b/compiler/rustc_lint/src/lib.rs @@ -21,8 +21,6 @@ // tidy-alphabetical-start #![allow(internal_features)] -#![cfg_attr(bootstrap, feature(assert_matches))] -#![cfg_attr(bootstrap, feature(if_let_guard))] #![feature(box_patterns)] #![feature(iter_order_by)] #![feature(rustc_attrs)] diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index 2ef1d5bd1426..38ffecbafa06 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -865,7 +865,6 @@ /// ### Example /// /// ```rust - /// # #![cfg_attr(bootstrap, feature(cfg_select))] /// cfg_select! { /// _ => (), /// windows => (), diff --git a/compiler/rustc_macros/src/query.rs b/compiler/rustc_macros/src/query.rs index 8f0bfed2035c..34c32eccd2bc 100644 --- a/compiler/rustc_macros/src/query.rs +++ b/compiler/rustc_macros/src/query.rs @@ -344,8 +344,7 @@ fn make_helpers_for_query(query: &Query, streams: &mut HelperTokenStreams) { if let Some(CacheOnDiskIf { block, .. }) = modifiers.cache_on_disk_if.as_ref() { // `disallowed_pass_by_ref` is needed because some keys are `rustc_pass_by_value`. streams.cache_on_disk_if_fns_stream.extend(quote! { - #[cfg_attr(not(bootstrap), allow(unused_variables, rustc::disallowed_pass_by_ref))] - #[cfg_attr(bootstrap, allow(unused_variables, rustc::pass_by_value))] + #[allow(unused_variables, rustc::disallowed_pass_by_ref)] #[inline] pub fn #erased_name<'tcx>(tcx: TyCtxt<'tcx>, #key_pat: &#key_ty) -> bool #block diff --git a/compiler/rustc_metadata/src/lib.rs b/compiler/rustc_metadata/src/lib.rs index cfd518c9e8fe..1dff5740ab3b 100644 --- a/compiler/rustc_metadata/src/lib.rs +++ b/compiler/rustc_metadata/src/lib.rs @@ -1,6 +1,5 @@ // tidy-alphabetical-start #![allow(internal_features)] -#![cfg_attr(bootstrap, feature(if_let_guard))] #![feature(error_iter)] #![feature(file_buffered)] #![feature(gen_blocks)] diff --git a/compiler/rustc_middle/src/lib.rs b/compiler/rustc_middle/src/lib.rs index 615381b37cdb..84fe59b3f711 100644 --- a/compiler/rustc_middle/src/lib.rs +++ b/compiler/rustc_middle/src/lib.rs @@ -27,8 +27,6 @@ // tidy-alphabetical-start #![allow(internal_features)] #![allow(rustc::direct_use_of_rustc_type_ir)] -#![cfg_attr(bootstrap, feature(assert_matches))] -#![cfg_attr(bootstrap, feature(if_let_guard))] #![cfg_attr(doc, feature(intra_doc_pointers))] #![feature(allocator_api)] #![feature(associated_type_defaults)] diff --git a/compiler/rustc_mir_build/src/lib.rs b/compiler/rustc_mir_build/src/lib.rs index 7637ea81b010..783d40781dac 100644 --- a/compiler/rustc_mir_build/src/lib.rs +++ b/compiler/rustc_mir_build/src/lib.rs @@ -1,8 +1,6 @@ //! Construction of MIR from HIR. // tidy-alphabetical-start -#![cfg_attr(bootstrap, feature(assert_matches))] -#![cfg_attr(bootstrap, feature(if_let_guard))] #![feature(box_patterns)] #![feature(try_blocks)] // tidy-alphabetical-end diff --git a/compiler/rustc_mir_dataflow/src/lib.rs b/compiler/rustc_mir_dataflow/src/lib.rs index 692591a41a15..c5026c1c92aa 100644 --- a/compiler/rustc_mir_dataflow/src/lib.rs +++ b/compiler/rustc_mir_dataflow/src/lib.rs @@ -1,5 +1,4 @@ // tidy-alphabetical-start -#![cfg_attr(bootstrap, feature(assert_matches))] #![feature(associated_type_defaults)] #![feature(box_patterns)] #![feature(exact_size_is_empty)] diff --git a/compiler/rustc_mir_transform/src/check_alignment.rs b/compiler/rustc_mir_transform/src/check_alignment.rs index 5085905aa42b..f481a73bfbe5 100644 --- a/compiler/rustc_mir_transform/src/check_alignment.rs +++ b/compiler/rustc_mir_transform/src/check_alignment.rs @@ -82,7 +82,6 @@ fn insert_alignment_check<'tcx>( // If this target does not have reliable alignment, further limit the mask by anding it with // the mask for the highest reliable alignment. - #[cfg_attr(bootstrap, expect(irrefutable_let_patterns))] if let max_align = tcx.sess.target.max_reliable_alignment() && max_align < Align::MAX { diff --git a/compiler/rustc_mir_transform/src/gvn.rs b/compiler/rustc_mir_transform/src/gvn.rs index 0960859fb2a4..517bc61e5eb0 100644 --- a/compiler/rustc_mir_transform/src/gvn.rs +++ b/compiler/rustc_mir_transform/src/gvn.rs @@ -302,8 +302,7 @@ fn insert_unique( /// Insert a `(Value, Ty)` pair to be deduplicated. /// Returns `true` as second tuple field if this value did not exist previously. - #[cfg_attr(not(bootstrap), allow(rustc::disallowed_pass_by_ref))] // closures take `&VnIndex` - #[cfg_attr(bootstrap, allow(rustc::pass_by_value))] + #[allow(rustc::disallowed_pass_by_ref)] // closures take `&VnIndex` fn insert(&mut self, ty: Ty<'tcx>, value: Value<'a, 'tcx>) -> (VnIndex, bool) { debug_assert!(match value { Value::Opaque(_) | Value::Address { .. } => false, diff --git a/compiler/rustc_mir_transform/src/lib.rs b/compiler/rustc_mir_transform/src/lib.rs index 92966bcb4795..c393c7d5166f 100644 --- a/compiler/rustc_mir_transform/src/lib.rs +++ b/compiler/rustc_mir_transform/src/lib.rs @@ -1,6 +1,4 @@ // tidy-alphabetical-start -#![cfg_attr(bootstrap, feature(assert_matches))] -#![cfg_attr(bootstrap, feature(if_let_guard))] #![feature(box_patterns)] #![feature(const_type_name)] #![feature(cow_is_borrowed)] diff --git a/compiler/rustc_monomorphize/src/lib.rs b/compiler/rustc_monomorphize/src/lib.rs index abe63e073ad7..ae97bf830d8c 100644 --- a/compiler/rustc_monomorphize/src/lib.rs +++ b/compiler/rustc_monomorphize/src/lib.rs @@ -1,5 +1,4 @@ // tidy-alphabetical-start -#![cfg_attr(bootstrap, feature(if_let_guard))] #![feature(file_buffered)] #![feature(impl_trait_in_assoc_type)] #![feature(once_cell_get_mut)] diff --git a/compiler/rustc_parse/src/lib.rs b/compiler/rustc_parse/src/lib.rs index 3953e35e1bdd..6b8d6baac945 100644 --- a/compiler/rustc_parse/src/lib.rs +++ b/compiler/rustc_parse/src/lib.rs @@ -1,8 +1,6 @@ //! The main parser interface. // tidy-alphabetical-start -#![cfg_attr(bootstrap, feature(assert_matches))] -#![cfg_attr(bootstrap, feature(if_let_guard))] #![cfg_attr(test, feature(iter_order_by))] #![feature(box_patterns)] #![feature(debug_closure_helpers)] diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index 6b3b5e2ec45f..2c055bd22a8f 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -8,9 +8,6 @@ // tidy-alphabetical-start #![allow(internal_features)] -#![cfg_attr(bootstrap, feature(assert_matches))] -#![cfg_attr(bootstrap, feature(if_let_guard))] -#![cfg_attr(bootstrap, feature(ptr_as_ref_unchecked))] #![feature(arbitrary_self_types)] #![feature(box_patterns)] #![feature(const_default)] diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs index 954c82998ed7..a1d43d986384 100644 --- a/compiler/rustc_span/src/lib.rs +++ b/compiler/rustc_span/src/lib.rs @@ -17,8 +17,6 @@ // tidy-alphabetical-start #![allow(internal_features)] -#![cfg_attr(bootstrap, feature(cfg_select))] -#![cfg_attr(bootstrap, feature(if_let_guard))] #![cfg_attr(target_arch = "loongarch64", feature(stdarch_loongarch))] #![feature(core_io_borrowed_buf)] #![feature(map_try_insert)] diff --git a/compiler/rustc_symbol_mangling/src/lib.rs b/compiler/rustc_symbol_mangling/src/lib.rs index 35a3d0dac8af..ae0f5ec2a72d 100644 --- a/compiler/rustc_symbol_mangling/src/lib.rs +++ b/compiler/rustc_symbol_mangling/src/lib.rs @@ -87,10 +87,6 @@ //! virtually impossible. Thus, symbol hash generation exclusively relies on //! DefPaths which are much more robust in the face of changes to the code base. -// tidy-alphabetical-start -#![cfg_attr(bootstrap, feature(assert_matches))] -// tidy-alphabetical-end - use rustc_hir::def::DefKind; use rustc_hir::def_id::{CrateNum, LOCAL_CRATE}; use rustc_middle::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs}; diff --git a/compiler/rustc_trait_selection/src/lib.rs b/compiler/rustc_trait_selection/src/lib.rs index 5677a849d749..f0c67e4b4f89 100644 --- a/compiler/rustc_trait_selection/src/lib.rs +++ b/compiler/rustc_trait_selection/src/lib.rs @@ -11,8 +11,6 @@ //! This API is completely unstable and subject to change. // tidy-alphabetical-start -#![cfg_attr(bootstrap, feature(assert_matches))] -#![cfg_attr(bootstrap, feature(if_let_guard))] #![feature(associated_type_defaults)] #![feature(box_patterns)] #![feature(default_field_values)] diff --git a/compiler/rustc_ty_utils/src/lib.rs b/compiler/rustc_ty_utils/src/lib.rs index 2e21efbde1ac..5f42a134ec9a 100644 --- a/compiler/rustc_ty_utils/src/lib.rs +++ b/compiler/rustc_ty_utils/src/lib.rs @@ -5,8 +5,6 @@ //! This API is completely unstable and subject to change. // tidy-alphabetical-start -#![cfg_attr(bootstrap, feature(assert_matches))] -#![cfg_attr(bootstrap, feature(if_let_guard))] #![feature(associated_type_defaults)] #![feature(box_patterns)] #![feature(iterator_try_collect)] diff --git a/src/librustdoc/clean/utils.rs b/src/librustdoc/clean/utils.rs index 2f5f2a3f5a68..b264bfb2a573 100644 --- a/src/librustdoc/clean/utils.rs +++ b/src/librustdoc/clean/utils.rs @@ -1,6 +1,3 @@ -#[cfg(bootstrap)] -pub use std::assert_matches::debug_assert_matches; -#[cfg(not(bootstrap))] pub use std::debug_assert_matches; use std::fmt::{self, Display, Write as _}; use std::sync::LazyLock as Lazy; diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 8cad0210ea34..55075001e0fe 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -1,6 +1,4 @@ // tidy-alphabetical-start -#![cfg_attr(bootstrap, feature(assert_matches))] -#![cfg_attr(bootstrap, feature(if_let_guard))] #![doc( html_root_url = "https://doc.rust-lang.org/nightly/", html_playground_url = "https://play.rust-lang.org/" diff --git a/src/tools/clippy/clippy_lints/src/lib.rs b/src/tools/clippy/clippy_lints/src/lib.rs index 4dca8dfe94d0..4d67c158c043 100644 --- a/src/tools/clippy/clippy_lints/src/lib.rs +++ b/src/tools/clippy/clippy_lints/src/lib.rs @@ -1,4 +1,3 @@ -#![cfg_attr(bootstrap, feature(if_let_guard))] #![feature(box_patterns)] #![feature(control_flow_into_value)] #![feature(exact_div)] diff --git a/src/tools/clippy/clippy_utils/src/lib.rs b/src/tools/clippy/clippy_utils/src/lib.rs index 13c687a82b13..1e73e43e0a71 100644 --- a/src/tools/clippy/clippy_utils/src/lib.rs +++ b/src/tools/clippy/clippy_utils/src/lib.rs @@ -1,9 +1,7 @@ -#![cfg_attr(bootstrap, feature(if_let_guard))] #![feature(box_patterns)] #![feature(macro_metavar_expr)] #![feature(never_type)] #![feature(rustc_private)] -#![cfg_attr(bootstrap, feature(assert_matches))] #![feature(unwrap_infallible)] #![recursion_limit = "512"] #![allow(clippy::missing_errors_doc, clippy::missing_panics_doc, clippy::must_use_candidate)] diff --git a/src/tools/clippy/clippy_utils/src/ty/mod.rs b/src/tools/clippy/clippy_utils/src/ty/mod.rs index a9e29987bc32..af514778f968 100644 --- a/src/tools/clippy/clippy_utils/src/ty/mod.rs +++ b/src/tools/clippy/clippy_utils/src/ty/mod.rs @@ -28,10 +28,7 @@ use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt as _; use rustc_trait_selection::traits::query::normalize::QueryNormalizeExt; use rustc_trait_selection::traits::{Obligation, ObligationCause}; -#[cfg(bootstrap)] -use std::assert_matches::debug_assert_matches; use std::collections::hash_map::Entry; -#[cfg(not(bootstrap))] use std::debug_assert_matches; use std::{iter, mem}; diff --git a/src/tools/miri/cargo-miri/src/setup.rs b/src/tools/miri/cargo-miri/src/setup.rs index 76e9e62f5200..47c99f939254 100644 --- a/src/tools/miri/cargo-miri/src/setup.rs +++ b/src/tools/miri/cargo-miri/src/setup.rs @@ -89,10 +89,7 @@ pub fn setup( let cargo_cmd = { let mut command = cargo(); // Allow JSON targets since users do not have a good way to set this flag otherwise. - if env::var("RUSTC_STAGE").is_err() { - // ^ is a HACK for bootstrap cargo. FIXME(cfg(bootstrap)) remove the hack. - command.arg("-Zjson-target-spec"); - } + command.arg("-Zjson-target-spec"); // Use Miri as rustc to build a libstd compatible with us (and use the right flags). // We set ourselves (`cargo-miri`) instead of Miri directly to be able to patch the flags // for `libpanic_abort` (usually this is done by bootstrap but we have to do it ourselves). diff --git a/src/tools/miri/src/lib.rs b/src/tools/miri/src/lib.rs index 155140165458..244203587950 100644 --- a/src/tools/miri/src/lib.rs +++ b/src/tools/miri/src/lib.rs @@ -1,5 +1,3 @@ -#![cfg_attr(bootstrap, feature(if_let_guard))] -#![cfg_attr(bootstrap, feature(cfg_select))] #![feature(abort_unwind)] #![feature(rustc_private)] #![feature(float_gamma)] diff --git a/src/tools/miri/src/shims/foreign_items.rs b/src/tools/miri/src/shims/foreign_items.rs index 12a170e6a849..536e77217d83 100644 --- a/src/tools/miri/src/shims/foreign_items.rs +++ b/src/tools/miri/src/shims/foreign_items.rs @@ -851,7 +851,6 @@ fn emulate_foreign_item_inner( // Fallback to shims in submodules. _ => { // Math shims - #[cfg_attr(bootstrap, expect(irrefutable_let_patterns))] if let res = shims::math::EvalContextExt::emulate_foreign_item_inner( this, link_name, abi, args, dest, )? && !matches!(res, EmulateItemResult::NotSupported)