update cfg(bootstrap)s

This commit is contained in:
Pietro Albini 2022-01-14 09:50:49 +01:00
parent 970e603006
commit 5b3462c556
No known key found for this signature in database
GPG key ID: CD76B35F7734769E
16 changed files with 55 additions and 112 deletions

View file

@ -2,7 +2,6 @@
#![feature(associated_type_defaults)] #![feature(associated_type_defaults)]
#![feature(crate_visibility_modifier)] #![feature(crate_visibility_modifier)]
#![feature(decl_macro)] #![feature(decl_macro)]
#![cfg_attr(bootstrap, feature(destructuring_assignment))]
#![feature(if_let_guard)] #![feature(if_let_guard)]
#![feature(let_else)] #![feature(let_else)]
#![feature(proc_macro_diagnostic)] #![feature(proc_macro_diagnostic)]

View file

@ -784,18 +784,6 @@ rustc_queries! {
desc { |tcx| "type-checking `{}`", tcx.def_path_str(key.to_def_id()) } desc { |tcx| "type-checking `{}`", tcx.def_path_str(key.to_def_id()) }
cache_on_disk_if { true } cache_on_disk_if { true }
load_cached(tcx, id) { load_cached(tcx, id) {
#[cfg(bootstrap)]
{
match match tcx.on_disk_cache().as_ref() {
Some(c) => c.try_load_query_result(*tcx, id),
None => None,
} {
Some(x) => Some(&*tcx.arena.alloc(x)),
None => None,
}
}
#[cfg(not(bootstrap))]
{
let typeck_results: Option<ty::TypeckResults<'tcx>> = tcx let typeck_results: Option<ty::TypeckResults<'tcx>> = tcx
.on_disk_cache().as_ref() .on_disk_cache().as_ref()
.and_then(|c| c.try_load_query_result(*tcx, id)); .and_then(|c| c.try_load_query_result(*tcx, id));
@ -803,7 +791,6 @@ rustc_queries! {
typeck_results.map(|x| &*tcx.arena.alloc(x)) typeck_results.map(|x| &*tcx.arena.alloc(x))
} }
} }
}
query used_trait_imports(key: LocalDefId) -> &'tcx FxHashSet<LocalDefId> { query used_trait_imports(key: LocalDefId) -> &'tcx FxHashSet<LocalDefId> {
desc { |tcx| "used_trait_imports `{}`", tcx.def_path_str(key.to_def_id()) } desc { |tcx| "used_trait_imports `{}`", tcx.def_path_str(key.to_def_id()) }

View file

@ -67,17 +67,14 @@
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/", issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/",
test(no_crate_inject, attr(allow(unused_variables), deny(warnings))) test(no_crate_inject, attr(allow(unused_variables), deny(warnings)))
)] )]
#![cfg_attr( #![doc(cfg_hide(
not(bootstrap),
doc(cfg_hide(
not(test), not(test),
not(any(test, bootstrap)), not(any(test, bootstrap)),
any(not(feature = "miri-test-libstd"), test, doctest), any(not(feature = "miri-test-libstd"), test, doctest),
no_global_oom_handling, no_global_oom_handling,
not(no_global_oom_handling), not(no_global_oom_handling),
target_has_atomic = "ptr" target_has_atomic = "ptr"
)) ))]
)]
#![no_std] #![no_std]
#![needs_allocator] #![needs_allocator]
// //
@ -151,7 +148,6 @@
#![feature(const_precise_live_drops)] #![feature(const_precise_live_drops)]
#![feature(const_trait_impl)] #![feature(const_trait_impl)]
#![feature(const_try)] #![feature(const_try)]
#![cfg_attr(bootstrap, feature(destructuring_assignment))]
#![feature(dropck_eyepatch)] #![feature(dropck_eyepatch)]
#![feature(exclusive_range_pattern)] #![feature(exclusive_range_pattern)]
#![feature(fundamental)] #![feature(fundamental)]

View file

@ -1310,11 +1310,7 @@ impl Clone for BorrowRef<'_> {
/// ///
/// See the [module-level documentation](self) for more. /// See the [module-level documentation](self) for more.
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr( #[must_not_suspend = "holding a Ref across suspend points can cause BorrowErrors"]
not(bootstrap),
must_not_suspend = "holding a Ref across suspend \
points can cause BorrowErrors"
)]
pub struct Ref<'b, T: ?Sized + 'b> { pub struct Ref<'b, T: ?Sized + 'b> {
value: &'b T, value: &'b T,
borrow: BorrowRef<'b>, borrow: BorrowRef<'b>,
@ -1692,11 +1688,7 @@ impl<'b> BorrowRefMut<'b> {
/// ///
/// See the [module-level documentation](self) for more. /// See the [module-level documentation](self) for more.
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr( #[must_not_suspend = "holding a RefMut across suspend points can cause BorrowErrors"]
not(bootstrap),
must_not_suspend = "holding a RefMut across suspend \
points can cause BorrowErrors"
)]
pub struct RefMut<'b, T: ?Sized + 'b> { pub struct RefMut<'b, T: ?Sized + 'b> {
value: &'b mut T, value: &'b mut T,
borrow: BorrowRefMut<'b>, borrow: BorrowRefMut<'b>,

View file

@ -13,7 +13,7 @@ pub trait IntoFuture {
/// Creates a future from a value. /// Creates a future from a value.
#[unstable(feature = "into_future", issue = "67644")] #[unstable(feature = "into_future", issue = "67644")]
#[cfg_attr(not(bootstrap), lang = "into_future")] #[lang = "into_future"]
fn into_future(self) -> Self::Future; fn into_future(self) -> Self::Future;
} }

View file

@ -60,9 +60,7 @@
test(no_crate_inject, attr(deny(warnings))), test(no_crate_inject, attr(deny(warnings))),
test(attr(allow(dead_code, deprecated, unused_variables, unused_mut))) test(attr(allow(dead_code, deprecated, unused_variables, unused_mut)))
)] )]
#![cfg_attr( #![doc(cfg_hide(
not(bootstrap),
doc(cfg_hide(
not(test), not(test),
any(not(feature = "miri-test-libstd"), test, doctest), any(not(feature = "miri-test-libstd"), test, doctest),
no_fp_fmt_parse, no_fp_fmt_parse,
@ -84,8 +82,7 @@
target_has_atomic_load_store = "32", target_has_atomic_load_store = "32",
target_has_atomic_load_store = "64", target_has_atomic_load_store = "64",
target_has_atomic_load_store = "ptr", target_has_atomic_load_store = "ptr",
)) ))]
)]
#![no_core] #![no_core]
// //
// Lints: // Lints:

View file

@ -1003,7 +1003,6 @@ pub(crate) mod builtin {
/// assert_eq!(s, b"ABCDEF"); /// assert_eq!(s, b"ABCDEF");
/// # } /// # }
/// ``` /// ```
#[cfg(not(bootstrap))]
#[unstable(feature = "concat_bytes", issue = "87555")] #[unstable(feature = "concat_bytes", issue = "87555")]
#[rustc_builtin_macro] #[rustc_builtin_macro]
#[macro_export] #[macro_export]

View file

@ -65,7 +65,6 @@ pub use crate::{
issue = "87555", issue = "87555",
reason = "`concat_bytes` is not stable enough for use and is subject to change" reason = "`concat_bytes` is not stable enough for use and is subject to change"
)] )]
#[cfg(not(bootstrap))]
#[doc(no_inline)] #[doc(no_inline)]
pub use crate::concat_bytes; pub use crate::concat_bytes;

View file

@ -204,7 +204,6 @@ fn cmp_default() {
assert_eq!(Fool(false), Fool(true)); assert_eq!(Fool(false), Fool(true));
} }
#[cfg(not(bootstrap))]
mod const_cmp { mod const_cmp {
use super::*; use super::*;

View file

@ -37,7 +37,6 @@ fn test_assume_can_be_in_const_contexts() {
} }
#[test] #[test]
#[cfg(not(bootstrap))]
const fn test_write_bytes_in_const_contexts() { const fn test_write_bytes_in_const_contexts() {
use core::intrinsics::write_bytes; use core::intrinsics::write_bytes;

View file

@ -251,7 +251,6 @@ fn test_set_memory() {
} }
#[test] #[test]
#[cfg(not(bootstrap))]
fn test_set_memory_const() { fn test_set_memory_const() {
const XS: [u8; 20] = { const XS: [u8; 20] = {
let mut xs = [0u8; 20]; let mut xs = [0u8; 20];

View file

@ -195,15 +195,12 @@
test(no_crate_inject, attr(deny(warnings))), test(no_crate_inject, attr(deny(warnings))),
test(attr(allow(dead_code, deprecated, unused_variables, unused_mut))) test(attr(allow(dead_code, deprecated, unused_variables, unused_mut)))
)] )]
#![cfg_attr( #![doc(cfg_hide(
not(bootstrap),
doc(cfg_hide(
not(test), not(test),
not(any(test, bootstrap)), not(any(test, bootstrap)),
no_global_oom_handling, no_global_oom_handling,
not(no_global_oom_handling) not(no_global_oom_handling)
)) ))]
)]
// Don't link to std. We are std. // Don't link to std. We are std.
#![no_std] #![no_std]
#![warn(deprecated_in_future)] #![warn(deprecated_in_future)]
@ -249,7 +246,7 @@
#![feature(cfg_target_thread_local)] #![feature(cfg_target_thread_local)]
#![feature(char_error_internals)] #![feature(char_error_internals)]
#![feature(char_internals)] #![feature(char_internals)]
#![cfg_attr(not(bootstrap), feature(concat_bytes))] #![feature(concat_bytes)]
#![feature(concat_idents)] #![feature(concat_idents)]
#![feature(const_fn_floating_point_arithmetic)] #![feature(const_fn_floating_point_arithmetic)]
#![feature(const_fn_fn_ptr_basics)] #![feature(const_fn_fn_ptr_basics)]
@ -578,7 +575,6 @@ pub use core::{
issue = "87555", issue = "87555",
reason = "`concat_bytes` is not stable enough for use and is subject to change" reason = "`concat_bytes` is not stable enough for use and is subject to change"
)] )]
#[cfg(not(bootstrap))]
pub use core::concat_bytes; pub use core::concat_bytes;
#[stable(feature = "core_primitive", since = "1.43.0")] #[stable(feature = "core_primitive", since = "1.43.0")]

View file

@ -49,7 +49,6 @@ pub use core::prelude::v1::{
issue = "87555", issue = "87555",
reason = "`concat_bytes` is not stable enough for use and is subject to change" reason = "`concat_bytes` is not stable enough for use and is subject to change"
)] )]
#[cfg(not(bootstrap))]
#[doc(no_inline)] #[doc(no_inline)]
pub use core::prelude::v1::concat_bytes; pub use core::prelude::v1::concat_bytes;

View file

@ -188,12 +188,9 @@ unsafe impl<T: ?Sized + Send> Sync for Mutex<T> {}
/// [`lock`]: Mutex::lock /// [`lock`]: Mutex::lock
/// [`try_lock`]: Mutex::try_lock /// [`try_lock`]: Mutex::try_lock
#[must_use = "if unused the Mutex will immediately unlock"] #[must_use = "if unused the Mutex will immediately unlock"]
#[cfg_attr( #[must_not_suspend = "holding a MutexGuard across suspend \
not(bootstrap),
must_not_suspend = "holding a MutexGuard across suspend \
points can cause deadlocks, delays, \ points can cause deadlocks, delays, \
and cause Futures to not implement `Send`" and cause Futures to not implement `Send`"]
)]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub struct MutexGuard<'a, T: ?Sized + 'a> { pub struct MutexGuard<'a, T: ?Sized + 'a> {
lock: &'a Mutex<T>, lock: &'a Mutex<T>,

View file

@ -95,12 +95,9 @@ unsafe impl<T: ?Sized + Send + Sync> Sync for RwLock<T> {}
/// [`read`]: RwLock::read /// [`read`]: RwLock::read
/// [`try_read`]: RwLock::try_read /// [`try_read`]: RwLock::try_read
#[must_use = "if unused the RwLock will immediately unlock"] #[must_use = "if unused the RwLock will immediately unlock"]
#[cfg_attr( #[must_not_suspend = "holding a RwLockReadGuard across suspend \
not(bootstrap),
must_not_suspend = "holding a RwLockReadGuard across suspend \
points can cause deadlocks, delays, \ points can cause deadlocks, delays, \
and cause Futures to not implement `Send`" and cause Futures to not implement `Send`"]
)]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub struct RwLockReadGuard<'a, T: ?Sized + 'a> { pub struct RwLockReadGuard<'a, T: ?Sized + 'a> {
lock: &'a RwLock<T>, lock: &'a RwLock<T>,
@ -121,12 +118,9 @@ unsafe impl<T: ?Sized + Sync> Sync for RwLockReadGuard<'_, T> {}
/// [`write`]: RwLock::write /// [`write`]: RwLock::write
/// [`try_write`]: RwLock::try_write /// [`try_write`]: RwLock::try_write
#[must_use = "if unused the RwLock will immediately unlock"] #[must_use = "if unused the RwLock will immediately unlock"]
#[cfg_attr( #[must_not_suspend = "holding a RwLockWriteGuard across suspend \
not(bootstrap),
must_not_suspend = "holding a RwLockWriteGuard across suspend \
points can cause deadlocks, delays, \ points can cause deadlocks, delays, \
and cause Future's to not implement `Send`" and cause Future's to not implement `Send`"]
)]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub struct RwLockWriteGuard<'a, T: ?Sized + 'a> { pub struct RwLockWriteGuard<'a, T: ?Sized + 'a> {
lock: &'a RwLock<T>, lock: &'a RwLock<T>,

View file

@ -988,21 +988,12 @@ impl<'a> Builder<'a> {
} }
}; };
// cfg(bootstrap) -- drop the compiler.stage == 0 branch.
if compiler.stage == 0 {
if use_new_symbol_mangling {
rustflags.arg("-Zsymbol-mangling-version=v0");
} else {
rustflags.arg("-Zsymbol-mangling-version=legacy");
}
} else {
if use_new_symbol_mangling { if use_new_symbol_mangling {
rustflags.arg("-Csymbol-mangling-version=v0"); rustflags.arg("-Csymbol-mangling-version=v0");
} else { } else {
rustflags.arg("-Csymbol-mangling-version=legacy"); rustflags.arg("-Csymbol-mangling-version=legacy");
rustflags.arg("-Zunstable-options"); rustflags.arg("-Zunstable-options");
} }
}
// FIXME: It might be better to use the same value for both `RUSTFLAGS` and `RUSTDOCFLAGS`, // FIXME: It might be better to use the same value for both `RUSTFLAGS` and `RUSTDOCFLAGS`,
// but this breaks CI. At the very least, stage0 `rustdoc` needs `--cfg bootstrap`. See // but this breaks CI. At the very least, stage0 `rustdoc` needs `--cfg bootstrap`. See