Skip to content

Commit

Permalink
Auto merge of #93482 - ehuss:rollup-qjyppci, r=ehuss
Browse files Browse the repository at this point in the history
Rollup of 5 pull requests

Successful merges:

 - #92887 (Bootstrap compiler update)
 - #92908 (Render more readable macro matcher tokens in rustdoc)
 - #93183 (rustdoc: mobile nav fixes)
 - #93192 (Add VS 2022 into error message)
 - #93475 (Add test to ensure that theme is applied correctly when going back in history)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Jan 30, 2022
2 parents 7cc28c1 + 5e48378 commit 8c7f2bf
Show file tree
Hide file tree
Showing 34 changed files with 739 additions and 514 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_ast_pretty/src/pp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ impl Printer {
self.break_offset(n, 0)
}

crate fn zerobreak(&mut self) {
pub fn zerobreak(&mut self) {
self.spaces(0)
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>(
but `link.exe` was not found",
);
sess.note_without_error(
"please ensure that VS 2013, VS 2015, VS 2017 or VS 2019 \
"please ensure that VS 2013, VS 2015, VS 2017, VS 2019 or VS 2022 \
was installed with the Visual C++ option",
);
}
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_expand/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#![feature(associated_type_defaults)]
#![feature(crate_visibility_modifier)]
#![feature(decl_macro)]
#![cfg_attr(bootstrap, feature(destructuring_assignment))]
#![feature(if_let_guard)]
#![feature(let_else)]
#![feature(proc_macro_diagnostic)]
Expand Down
21 changes: 4 additions & 17 deletions compiler/rustc_middle/src/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -784,24 +784,11 @@ rustc_queries! {
desc { |tcx| "type-checking `{}`", tcx.def_path_str(key.to_def_id()) }
cache_on_disk_if { true }
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
.on_disk_cache().as_ref()
.and_then(|c| c.try_load_query_result(*tcx, id));
let typeck_results: Option<ty::TypeckResults<'tcx>> = tcx
.on_disk_cache().as_ref()
.and_then(|c| c.try_load_query_result(*tcx, id));

typeck_results.map(|x| &*tcx.arena.alloc(x))
}
typeck_results.map(|x| &*tcx.arena.alloc(x))
}
}

Expand Down
20 changes: 8 additions & 12 deletions library/alloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,14 @@
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/",
test(no_crate_inject, attr(allow(unused_variables), deny(warnings)))
)]
#![cfg_attr(
not(bootstrap),
doc(cfg_hide(
not(test),
not(any(test, bootstrap)),
any(not(feature = "miri-test-libstd"), test, doctest),
no_global_oom_handling,
not(no_global_oom_handling),
target_has_atomic = "ptr"
))
)]
#![doc(cfg_hide(
not(test),
not(any(test, bootstrap)),
any(not(feature = "miri-test-libstd"), test, doctest),
no_global_oom_handling,
not(no_global_oom_handling),
target_has_atomic = "ptr"
))]
#![no_std]
#![needs_allocator]
//
Expand Down Expand Up @@ -151,7 +148,6 @@
#![feature(const_precise_live_drops)]
#![feature(const_trait_impl)]
#![feature(const_try)]
#![cfg_attr(bootstrap, feature(destructuring_assignment))]
#![feature(dropck_eyepatch)]
#![feature(exclusive_range_pattern)]
#![feature(fundamental)]
Expand Down
12 changes: 2 additions & 10 deletions library/core/src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1310,11 +1310,7 @@ impl Clone for BorrowRef<'_> {
///
/// See the [module-level documentation](self) for more.
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(
not(bootstrap),
must_not_suspend = "holding a Ref across suspend \
points can cause BorrowErrors"
)]
#[must_not_suspend = "holding a Ref across suspend points can cause BorrowErrors"]
pub struct Ref<'b, T: ?Sized + 'b> {
value: &'b T,
borrow: BorrowRef<'b>,
Expand Down Expand Up @@ -1692,11 +1688,7 @@ impl<'b> BorrowRefMut<'b> {
///
/// See the [module-level documentation](self) for more.
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(
not(bootstrap),
must_not_suspend = "holding a RefMut across suspend \
points can cause BorrowErrors"
)]
#[must_not_suspend = "holding a RefMut across suspend points can cause BorrowErrors"]
pub struct RefMut<'b, T: ?Sized + 'b> {
value: &'b mut T,
borrow: BorrowRefMut<'b>,
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/future/into_future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub trait IntoFuture {

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

Expand Down
49 changes: 23 additions & 26 deletions library/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,32 +60,29 @@
test(no_crate_inject, attr(deny(warnings))),
test(attr(allow(dead_code, deprecated, unused_variables, unused_mut)))
)]
#![cfg_attr(
not(bootstrap),
doc(cfg_hide(
not(test),
any(not(feature = "miri-test-libstd"), test, doctest),
no_fp_fmt_parse,
target_pointer_width = "16",
target_pointer_width = "32",
target_pointer_width = "64",
target_has_atomic = "8",
target_has_atomic = "16",
target_has_atomic = "32",
target_has_atomic = "64",
target_has_atomic = "ptr",
target_has_atomic_equal_alignment = "8",
target_has_atomic_equal_alignment = "16",
target_has_atomic_equal_alignment = "32",
target_has_atomic_equal_alignment = "64",
target_has_atomic_equal_alignment = "ptr",
target_has_atomic_load_store = "8",
target_has_atomic_load_store = "16",
target_has_atomic_load_store = "32",
target_has_atomic_load_store = "64",
target_has_atomic_load_store = "ptr",
))
)]
#![doc(cfg_hide(
not(test),
any(not(feature = "miri-test-libstd"), test, doctest),
no_fp_fmt_parse,
target_pointer_width = "16",
target_pointer_width = "32",
target_pointer_width = "64",
target_has_atomic = "8",
target_has_atomic = "16",
target_has_atomic = "32",
target_has_atomic = "64",
target_has_atomic = "ptr",
target_has_atomic_equal_alignment = "8",
target_has_atomic_equal_alignment = "16",
target_has_atomic_equal_alignment = "32",
target_has_atomic_equal_alignment = "64",
target_has_atomic_equal_alignment = "ptr",
target_has_atomic_load_store = "8",
target_has_atomic_load_store = "16",
target_has_atomic_load_store = "32",
target_has_atomic_load_store = "64",
target_has_atomic_load_store = "ptr",
))]
#![no_core]
//
// Lints:
Expand Down
1 change: 0 additions & 1 deletion library/core/src/macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,6 @@ pub(crate) mod builtin {
/// assert_eq!(s, b"ABCDEF");
/// # }
/// ```
#[cfg(not(bootstrap))]
#[unstable(feature = "concat_bytes", issue = "87555")]
#[rustc_builtin_macro]
#[macro_export]
Expand Down
1 change: 0 additions & 1 deletion library/core/src/prelude/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ pub use crate::{
issue = "87555",
reason = "`concat_bytes` is not stable enough for use and is subject to change"
)]
#[cfg(not(bootstrap))]
#[doc(no_inline)]
pub use crate::concat_bytes;

Expand Down
1 change: 0 additions & 1 deletion library/core/tests/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ fn cmp_default() {
assert_eq!(Fool(false), Fool(true));
}

#[cfg(not(bootstrap))]
mod const_cmp {
use super::*;

Expand Down
1 change: 0 additions & 1 deletion library/core/tests/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ fn test_assume_can_be_in_const_contexts() {
}

#[test]
#[cfg(not(bootstrap))]
const fn test_write_bytes_in_const_contexts() {
use core::intrinsics::write_bytes;

Expand Down
1 change: 0 additions & 1 deletion library/core/tests/ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ fn test_set_memory() {
}

#[test]
#[cfg(not(bootstrap))]
fn test_set_memory_const() {
const XS: [u8; 20] = {
let mut xs = [0u8; 20];
Expand Down
18 changes: 7 additions & 11 deletions library/std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,12 @@
test(no_crate_inject, attr(deny(warnings))),
test(attr(allow(dead_code, deprecated, unused_variables, unused_mut)))
)]
#![cfg_attr(
not(bootstrap),
doc(cfg_hide(
not(test),
not(any(test, bootstrap)),
no_global_oom_handling,
not(no_global_oom_handling)
))
)]
#![doc(cfg_hide(
not(test),
not(any(test, bootstrap)),
no_global_oom_handling,
not(no_global_oom_handling)
))]
// Don't link to std. We are std.
#![no_std]
#![warn(deprecated_in_future)]
Expand Down Expand Up @@ -249,7 +246,7 @@
#![feature(cfg_target_thread_local)]
#![feature(char_error_internals)]
#![feature(char_internals)]
#![cfg_attr(not(bootstrap), feature(concat_bytes))]
#![feature(concat_bytes)]
#![feature(concat_idents)]
#![feature(const_fn_floating_point_arithmetic)]
#![feature(const_fn_fn_ptr_basics)]
Expand Down Expand Up @@ -585,7 +582,6 @@ pub use core::{
issue = "87555",
reason = "`concat_bytes` is not stable enough for use and is subject to change"
)]
#[cfg(not(bootstrap))]
pub use core::concat_bytes;

#[stable(feature = "core_primitive", since = "1.43.0")]
Expand Down
1 change: 0 additions & 1 deletion library/std/src/prelude/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ pub use core::prelude::v1::{
issue = "87555",
reason = "`concat_bytes` is not stable enough for use and is subject to change"
)]
#[cfg(not(bootstrap))]
#[doc(no_inline)]
pub use core::prelude::v1::concat_bytes;

Expand Down
7 changes: 2 additions & 5 deletions library/std/src/sync/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,9 @@ unsafe impl<T: ?Sized + Send> Sync for Mutex<T> {}
/// [`lock`]: Mutex::lock
/// [`try_lock`]: Mutex::try_lock
#[must_use = "if unused the Mutex will immediately unlock"]
#[cfg_attr(
not(bootstrap),
must_not_suspend = "holding a MutexGuard across suspend \
#[must_not_suspend = "holding a MutexGuard across suspend \
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")]
pub struct MutexGuard<'a, T: ?Sized + 'a> {
lock: &'a Mutex<T>,
Expand Down
14 changes: 4 additions & 10 deletions library/std/src/sync/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,9 @@ unsafe impl<T: ?Sized + Send + Sync> Sync for RwLock<T> {}
/// [`read`]: RwLock::read
/// [`try_read`]: RwLock::try_read
#[must_use = "if unused the RwLock will immediately unlock"]
#[cfg_attr(
not(bootstrap),
must_not_suspend = "holding a RwLockReadGuard across suspend \
#[must_not_suspend = "holding a RwLockReadGuard across suspend \
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")]
pub struct RwLockReadGuard<'a, T: ?Sized + 'a> {
lock: &'a RwLock<T>,
Expand All @@ -121,12 +118,9 @@ unsafe impl<T: ?Sized + Sync> Sync for RwLockReadGuard<'_, T> {}
/// [`write`]: RwLock::write
/// [`try_write`]: RwLock::try_write
#[must_use = "if unused the RwLock will immediately unlock"]
#[cfg_attr(
not(bootstrap),
must_not_suspend = "holding a RwLockWriteGuard across suspend \
#[must_not_suspend = "holding a RwLockWriteGuard across suspend \
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")]
pub struct RwLockWriteGuard<'a, T: ?Sized + 'a> {
lock: &'a RwLock<T>,
Expand Down
17 changes: 4 additions & 13 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1088,20 +1088,11 @@ 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");
}
if use_new_symbol_mangling {
rustflags.arg("-Csymbol-mangling-version=v0");
} else {
if use_new_symbol_mangling {
rustflags.arg("-Csymbol-mangling-version=v0");
} else {
rustflags.arg("-Csymbol-mangling-version=legacy");
rustflags.arg("-Zunstable-options");
}
rustflags.arg("-Csymbol-mangling-version=legacy");
rustflags.arg("-Zunstable-options");
}

// FIXME: It might be better to use the same value for both `RUSTFLAGS` and `RUSTDOCFLAGS`,
Expand Down
1 change: 1 addition & 0 deletions src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ mod auto_trait;
mod blanket_impl;
crate mod cfg;
crate mod inline;
mod render_macro_matchers;
mod simplify;
crate mod types;
crate mod utils;
Expand Down
Loading

0 comments on commit 8c7f2bf

Please sign in to comment.