Skip to content

Commit

Permalink
Switch bootstrap cfgs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Simulacrum committed Feb 25, 2022
1 parent ea65f50 commit 22c3a71
Show file tree
Hide file tree
Showing 56 changed files with 64 additions and 147 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/lib.rs
Expand Up @@ -35,7 +35,7 @@
#![feature(let_else)]
#![feature(never_type)]
#![recursion_limit = "256"]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

use rustc_ast::token::{self, Token};
use rustc_ast::tokenstream::{CanSynthesizeMissingTokens, TokenStream, TokenTree};
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_passes/src/lib.rs
Expand Up @@ -8,7 +8,7 @@
#![feature(box_patterns)]
#![feature(let_else)]
#![recursion_limit = "256"]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

pub mod ast_validation;
pub mod feature_gate;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/lib.rs
Expand Up @@ -9,7 +9,7 @@
#![feature(trusted_step)]
#![feature(try_blocks)]
#![recursion_limit = "256"]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

#[macro_use]
extern crate rustc_middle;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/lib.rs
Expand Up @@ -13,7 +13,7 @@
#![feature(proc_macro_internals)]
#![feature(proc_macro_quote)]
#![recursion_limit = "256"]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

extern crate proc_macro;

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/lib.rs
Expand Up @@ -11,7 +11,7 @@
#![feature(extern_types)]
#![feature(nll)]
#![recursion_limit = "256"]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

use back::write::{create_informational_target_machine, create_target_machine};

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/lib.rs
Expand Up @@ -7,7 +7,7 @@
#![feature(nll)]
#![feature(associated_type_bounds)]
#![recursion_limit = "256"]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

//! This crate contains codegen code that is used by all codegen backends (LLVM and others).
//! The backend-agnostic functions of this crate use functions defined in various traits that
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_const_eval/src/lib.rs
Expand Up @@ -22,7 +22,7 @@ Rust MIR: a lowered representation of Rust.
#![feature(trusted_step)]
#![feature(try_blocks)]
#![recursion_limit = "256"]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

#[macro_use]
extern crate tracing;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_data_structures/src/intern.rs
Expand Up @@ -20,7 +20,7 @@ mod private {
/// but you can only construct a `Interned` with `new_unchecked`, and not
/// directly.
#[derive(Debug)]
#[cfg_attr(not(bootstrap), rustc_pass_by_value)]
#[rustc_pass_by_value]
pub struct Interned<'a, T>(pub &'a T, pub private::PrivateZst);

impl<'a, T> Interned<'a, T> {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_data_structures/src/lib.rs
Expand Up @@ -28,7 +28,7 @@
#![feature(vec_into_raw_parts)]
#![allow(rustc::default_hash_types)]
#![deny(unaligned_references)]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

#[macro_use]
extern crate tracing;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_driver/src/lib.rs
Expand Up @@ -9,7 +9,7 @@
#![feature(let_else)]
#![feature(once_cell)]
#![recursion_limit = "256"]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

#[macro_use]
extern crate tracing;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_errors/src/lib.rs
Expand Up @@ -8,9 +8,9 @@
#![feature(if_let_guard)]
#![feature(let_else)]
#![feature(nll)]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![feature(adt_const_params)]
#![allow(incomplete_features)]
#![allow(rustc::potential_query_instability)]

#[macro_use]
extern crate rustc_macros;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_expand/src/lib.rs
Expand Up @@ -9,7 +9,7 @@
#![feature(proc_macro_span)]
#![feature(try_blocks)]
#![recursion_limit = "256"]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

#[macro_use]
extern crate rustc_macros;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_incremental/src/lib.rs
Expand Up @@ -5,7 +5,7 @@
#![feature(let_else)]
#![feature(nll)]
#![recursion_limit = "256"]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

#[macro_use]
extern crate rustc_middle;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_infer/src/lib.rs
Expand Up @@ -23,7 +23,7 @@
#![feature(min_specialization)]
#![feature(label_break_value)]
#![recursion_limit = "512"] // For rustdoc
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

#[macro_use]
extern crate rustc_macros;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_interface/src/lib.rs
Expand Up @@ -6,7 +6,7 @@
#![feature(nll)]
#![feature(once_cell)]
#![recursion_limit = "256"]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

mod callbacks;
pub mod interface;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/context.rs
Expand Up @@ -147,7 +147,7 @@ impl LintStore {
&'t self,
) -> impl Iterator<Item = (&'static str, Vec<LintId>, bool)> + 't {
// This function is not used in a way which observes the order of lints.
#[cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#[allow(rustc::potential_query_instability)]
self.lint_groups
.iter()
.filter(|(_, LintGroup { depr, .. })| {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/lib.rs
Expand Up @@ -38,7 +38,7 @@
#![feature(nll)]
#![feature(control_flow_enum)]
#![recursion_limit = "256"]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

#[macro_use]
extern crate rustc_middle;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_metadata/src/lib.rs
Expand Up @@ -9,7 +9,7 @@
#![feature(try_blocks)]
#![feature(never_type)]
#![recursion_limit = "256"]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

extern crate proc_macro;

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/lib.rs
Expand Up @@ -57,7 +57,7 @@
#![feature(unwrap_infallible)]
#![feature(decl_macro)]
#![recursion_limit = "512"]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

#[macro_use]
extern crate bitflags;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/consts.rs
Expand Up @@ -21,7 +21,7 @@ pub use valtree::*;

/// Use this rather than `ConstS`, whenever possible.
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, HashStable)]
#[cfg_attr(not(bootstrap), rustc_pass_by_value)]
#[rustc_pass_by_value]
pub struct Const<'tcx>(pub Interned<'tcx, ConstS<'tcx>>);

impl<'tcx> fmt::Debug for Const<'tcx> {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/context.rs
Expand Up @@ -970,7 +970,7 @@ pub struct FreeRegionInfo {
/// [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/ty.html
#[derive(Copy, Clone)]
#[rustc_diagnostic_item = "TyCtxt"]
#[cfg_attr(not(bootstrap), rustc_pass_by_value)]
#[rustc_pass_by_value]
pub struct TyCtxt<'tcx> {
gcx: &'tcx GlobalCtxt<'tcx>,
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_middle/src/ty/mod.rs
Expand Up @@ -433,7 +433,7 @@ static_assert_size!(TyS<'_>, 40);
/// Use this rather than `TyS`, whenever possible.
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[rustc_diagnostic_item = "Ty"]
#[cfg_attr(not(bootstrap), rustc_pass_by_value)]
#[rustc_pass_by_value]
pub struct Ty<'tcx>(Interned<'tcx, TyS<'tcx>>);

// Statics only used for internal testing.
Expand Down Expand Up @@ -486,7 +486,7 @@ static_assert_size!(PredicateS<'_>, 56);

/// Use this rather than `PredicateS`, whenever possible.
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(not(bootstrap), rustc_pass_by_value)]
#[rustc_pass_by_value]
pub struct Predicate<'tcx>(Interned<'tcx, PredicateS<'tcx>>);

impl<'tcx> Predicate<'tcx> {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/sty.rs
Expand Up @@ -1396,7 +1396,7 @@ impl ParamConst {

/// Use this rather than `TyKind`, whenever possible.
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, HashStable)]
#[cfg_attr(not(bootstrap), rustc_pass_by_value)]
#[rustc_pass_by_value]
pub struct Region<'tcx>(pub Interned<'tcx, RegionKind>);

impl<'tcx> Deref for Region<'tcx> {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_build/src/lib.rs
Expand Up @@ -9,7 +9,7 @@
#![feature(once_cell)]
#![feature(min_specialization)]
#![recursion_limit = "256"]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

#[macro_use]
extern crate tracing;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/lib.rs
Expand Up @@ -10,7 +10,7 @@
#![feature(trusted_step)]
#![feature(try_blocks)]
#![recursion_limit = "256"]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

#[macro_use]
extern crate tracing;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_monomorphize/src/lib.rs
Expand Up @@ -4,7 +4,7 @@
#![feature(control_flow_enum)]
#![feature(let_else)]
#![recursion_limit = "256"]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

#[macro_use]
extern crate tracing;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_passes/src/lib.rs
Expand Up @@ -13,7 +13,7 @@
#![feature(nll)]
#![feature(try_blocks)]
#![recursion_limit = "256"]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

#[macro_use]
extern crate rustc_middle;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_privacy/src/lib.rs
Expand Up @@ -4,7 +4,7 @@
#![feature(try_blocks)]
#![feature(associated_type_defaults)]
#![recursion_limit = "256"]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

use rustc_ast::MacroDef;
use rustc_attr as attr;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_query_impl/src/lib.rs
Expand Up @@ -7,7 +7,7 @@
#![feature(once_cell)]
#![feature(rustc_attrs)]
#![recursion_limit = "256"]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

#[macro_use]
extern crate rustc_macros;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_query_system/src/lib.rs
Expand Up @@ -5,7 +5,7 @@
#![feature(let_else)]
#![feature(min_specialization)]
#![feature(extern_types)]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

#[macro_use]
extern crate tracing;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_resolve/src/lib.rs
Expand Up @@ -18,7 +18,7 @@
#![feature(nll)]
#![recursion_limit = "256"]
#![allow(rustdoc::private_intra_doc_links)]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

#[macro_use]
extern crate tracing;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_save_analysis/src/lib.rs
Expand Up @@ -3,7 +3,7 @@
#![feature(nll)]
#![feature(let_else)]
#![recursion_limit = "256"]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

mod dump_visitor;
mod dumper;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_session/src/lib.rs
Expand Up @@ -4,7 +4,7 @@
#![feature(min_specialization)]
#![feature(once_cell)]
#![recursion_limit = "256"]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

#[macro_use]
extern crate rustc_macros;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_span/src/lib.rs
Expand Up @@ -22,7 +22,7 @@
#![feature(negative_impls)]
#![feature(nll)]
#![feature(min_specialization)]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

#[macro_use]
extern crate rustc_macros;
Expand Down
11 changes: 2 additions & 9 deletions compiler/rustc_span/src/span_encoding.rs
Expand Up @@ -61,15 +61,8 @@ use rustc_data_structures::fx::FxIndexSet;
/// using the callback `SPAN_TRACK` to access the query engine.
///
#[derive(Clone, Copy, Eq, PartialEq, Hash)]
// FIXME(@lcnr): Enable this attribute once the bootstrap
// compiler knows of `rustc_pass_by_value`.
//
// Right now, this lint would only trigger when compiling the
// stage 2 compiler, which is fairly annoying as there are
// a lot of places using `&Span` right now. After the next bootstrap bump,
// the lint will already trigger when using stage 1, which is a lot less annoying.
//
// #[cfg_attr(not(bootstrap), rustc_pass_by_value)]
// FIXME: Enable this in the bootstrap bump, but separate commit.
// #[rustc_pass_by_value]
pub struct Span {
base_or_index: u32,
len_or_tag: u16,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_symbol_mangling/src/lib.rs
Expand Up @@ -91,7 +91,7 @@
#![feature(never_type)]
#![feature(nll)]
#![recursion_limit = "256"]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

#[macro_use]
extern crate rustc_middle;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_trait_selection/src/lib.rs
Expand Up @@ -22,7 +22,7 @@
#![feature(crate_visibility_modifier)]
#![feature(control_flow_enum)]
#![recursion_limit = "512"] // For rustdoc
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

#[macro_use]
extern crate rustc_macros;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_typeck/src/lib.rs
Expand Up @@ -69,7 +69,7 @@ This API is completely unstable and subject to change.
#![feature(control_flow_enum)]
#![feature(hash_drain_filter)]
#![recursion_limit = "256"]
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
#![allow(rustc::potential_query_instability)]

#[macro_use]
extern crate tracing;
Expand Down
1 change: 0 additions & 1 deletion library/alloc/src/lib.rs
Expand Up @@ -139,7 +139,6 @@
#![feature(associated_type_bounds)]
#![feature(box_syntax)]
#![feature(cfg_sanitize)]
#![cfg_attr(bootstrap, feature(cfg_target_has_atomic))]
#![feature(const_deref)]
#![feature(const_fn_trait_bound)]
#![feature(const_mut_refs)]
Expand Down
1 change: 0 additions & 1 deletion library/core/src/intrinsics.rs
Expand Up @@ -1936,7 +1936,6 @@ extern "rust-intrinsic" {
/// - If the `ptr` is created in an another const, this intrinsic doesn't deallocate it.
/// - If the `ptr` is pointing to a local variable, this intrinsic doesn't deallocate it.
#[rustc_const_unstable(feature = "const_heap", issue = "79597")]
#[cfg(not(bootstrap))]
pub fn const_deallocate(ptr: *mut u8, size: usize, align: usize);

/// Determines whether the raw bytes of the two values are equal.
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/lib.rs
Expand Up @@ -156,7 +156,7 @@
#![feature(associated_type_bounds)]
#![feature(auto_traits)]
#![feature(cfg_target_has_atomic)]
#![cfg_attr(not(bootstrap), feature(cfg_target_has_atomic_equal_alignment))]
#![feature(cfg_target_has_atomic_equal_alignment)]
#![feature(const_fn_floating_point_arithmetic)]
#![feature(const_fn_fn_ptr_basics)]
#![feature(const_fn_trait_bound)]
Expand Down

0 comments on commit 22c3a71

Please sign in to comment.