Skip to content

Commit

Permalink
Auto merge of rust-lang#132282 - Noratrieb:it-is-the-end-of-serial, r…
Browse files Browse the repository at this point in the history
…=cjgillot

Delete the `cfg(not(parallel))` serial compiler

Since it's inception a long time ago, the parallel compiler and its cfgs have been a maintenance burden. This was a necessary evil the allow iteration while not degrading performance because of synchronization overhead.

But this time is over. Thanks to the amazing work by the parallel working group (and the dyn sync crimes), the parallel compiler has now been fast enough to be shipped by default in nightly for quite a while now.
Stable and beta have still been on the serial compiler, because they can't use `-Zthreads` anyways.
But this is quite suboptimal:
- the maintenance burden still sucks
- we're not testing the serial compiler in nightly

Because of these reasons, it's time to end it. The serial compiler has served us well in the years since it was split from the parallel one, but it's over now.

Let the knight slay one head of the two-headed dragon!

rust-lang#113349

Note that the default is still 1 thread, as more than 1 thread is still fairly broken.

cc `@onur-ozkan` to see if i did the bootstrap field removal correctly, `@SparrowLii` on the sync parts
  • Loading branch information
bors committed Nov 12, 2024
2 parents 583b25d + 505b8e1 commit 6503543
Show file tree
Hide file tree
Showing 42 changed files with 473 additions and 1,073 deletions.
1 change: 0 additions & 1 deletion compiler/rustc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@ jemalloc = ['dep:jemalloc-sys']
llvm = ['rustc_driver_impl/llvm']
max_level_info = ['rustc_driver_impl/max_level_info']
rustc_randomized_layouts = ['rustc_driver_impl/rustc_randomized_layouts']
rustc_use_parallel_compiler = ['rustc_driver_impl/rustc_use_parallel_compiler']
# tidy-alphabetical-end
1 change: 0 additions & 1 deletion compiler/rustc_ast/src/tokenstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ pub enum TokenTree {
}

// Ensure all fields of `TokenTree` are `DynSend` and `DynSync`.
#[cfg(parallel_compiler)]
fn _dummy()
where
Token: sync::DynSend + sync::DynSync,
Expand Down
7 changes: 1 addition & 6 deletions compiler/rustc_baked_icu_data/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ edition = "2021"
icu_list = "1.2"
icu_locid = "1.2"
icu_locid_transform = "1.3.2"
icu_provider = "1.2"
icu_provider = { version = "1.2", features = ["sync"] }
zerovec = "0.10.0"
# tidy-alphabetical-end

[features]
# tidy-alphabetical-start
rustc_use_parallel_compiler = ['icu_provider/sync']
# tidy-alphabetical-end
9 changes: 2 additions & 7 deletions compiler/rustc_data_structures/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ bitflags = "2.4.1"
either = "1.0"
elsa = "=1.7.1"
ena = "0.14.3"
indexmap = { version = "2.4.0" }
indexmap = { version = "2.4.0", features = ["rustc-rayon"] }
jobserver_crate = { version = "0.1.28", package = "jobserver" }
measureme = "11"
rustc-hash = "2.0.0"
rustc-rayon = { version = "0.5.0", optional = true }
rustc-rayon = "0.5.0"
rustc-stable-hash = { version = "0.1.0", features = ["nightly"] }
rustc_arena = { path = "../rustc_arena" }
rustc_graphviz = { path = "../rustc_graphviz" }
Expand Down Expand Up @@ -53,8 +53,3 @@ memmap2 = "0.2.1"

[target.'cfg(not(target_has_atomic = "64"))'.dependencies]
portable-atomic = "1.5.1"

[features]
# tidy-alphabetical-start
rustc_use_parallel_compiler = ["indexmap/rustc-rayon", "dep:rustc-rayon"]
# tidy-alphabetical-end
1 change: 0 additions & 1 deletion compiler/rustc_data_structures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#![allow(internal_features)]
#![allow(rustc::default_hash_types)]
#![allow(rustc::potential_query_instability)]
#![cfg_attr(not(parallel_compiler), feature(cell_leak))]
#![deny(unsafe_op_in_unsafe_fn)]
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![doc(rust_logo)]
Expand Down
Loading

0 comments on commit 6503543

Please sign in to comment.