1
Fork 0

Auto merge of #117435 - SparrowLii:nightly_parallel, r=oli-obk,davidtwco

enable parallel rustc front end in nightly builds

Refers to the [MCP](https://github.com/rust-lang/compiler-team/issues/681), this pr does:
1. Enable the parallel front end in nightly builds, and keep the default number of threads as 1. Then users can use the parallel rustc front end via -Z threads=n option.

2. Set it up to serial front end for beta/stable builds via bootstrap.

3. Switch over the alt builders from parallel rustc to serial, so we have artifacts without parallel to test against the artifacts with parallel.

r? `@oli-obk`

cc `@cjgillot` `@nnethercote` `@bjorn3` `@Kobzol`
This commit is contained in:
bors 2023-11-06 07:41:22 +00:00
commit f9b644636f
9 changed files with 41 additions and 13 deletions

View file

@ -138,7 +138,6 @@ cfg_match! {
[std::sync::atomic::AtomicUsize]
[std::sync::atomic::AtomicU8]
[std::sync::atomic::AtomicU32]
[std::sync::atomic::AtomicU64]
[std::backtrace::Backtrace]
[std::io::Error]
[std::fs::File]
@ -148,6 +147,18 @@ cfg_match! {
[crate::owned_slice::OwnedSlice]
);
// PowerPC and MIPS platforms with 32-bit pointers do not
// have AtomicU64 type.
#[cfg(not(any(target_arch = "powerpc", target_arch = "mips")))]
already_sync!(
[std::sync::atomic::AtomicU64]
);
#[cfg(any(target_arch = "powerpc", target_arch = "mips"))]
already_sync!(
[portable_atomic::AtomicU64]
);
macro_rules! impl_dyn_sync {
($($($attr: meta)* [$ty: ty where $($generics2: tt)*])*) => {
$(unsafe impl<$($generics2)*> DynSync for $ty {})*

View file

@ -265,7 +265,15 @@ cfg_match! {
pub use std::sync::OnceLock;
pub use std::sync::atomic::{AtomicBool, AtomicUsize, AtomicU32, AtomicU64};
pub use std::sync::atomic::{AtomicBool, AtomicUsize, AtomicU32};
// PowerPC and MIPS platforms with 32-bit pointers do not
// have AtomicU64 type.
#[cfg(not(any(target_arch = "powerpc", target_arch = "mips")))]
pub use std::sync::atomic::AtomicU64;
#[cfg(any(target_arch = "powerpc", target_arch = "mips"))]
pub use portable_atomic::AtomicU64;
pub use std::sync::Arc as Lrc;
pub use std::sync::Weak as Weak;