mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Update cfg(bootstrap)
This commit is contained in:
@@ -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))]
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -865,7 +865,6 @@
|
||||
/// ### Example
|
||||
///
|
||||
/// ```rust
|
||||
/// # #![cfg_attr(bootstrap, feature(cfg_select))]
|
||||
/// cfg_select! {
|
||||
/// _ => (),
|
||||
/// windows => (),
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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};
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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/"
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#![cfg_attr(bootstrap, feature(if_let_guard))]
|
||||
#![feature(box_patterns)]
|
||||
#![feature(control_flow_into_value)]
|
||||
#![feature(exact_div)]
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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};
|
||||
|
||||
|
||||
@@ -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).
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user