Skip to content

Commit c20654e

Browse files
committed
Auto merge of #64358 - cuviper:rustc-rayon-1.2, r=nikomatsakis
Rebase rustc-rayon on rayon-1.2 See also rust-lang/rustc-rayon#3
2 parents f3c9cec + 29cd7eb commit c20654e

File tree

7 files changed

+61
-25
lines changed

7 files changed

+61
-25
lines changed

Cargo.lock

+49-15
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,16 @@ dependencies = [
659659
"crossbeam-utils 0.6.5",
660660
]
661661

662+
[[package]]
663+
name = "crossbeam-deque"
664+
version = "0.7.1"
665+
source = "registry+https://github.com/rust-lang/crates.io-index"
666+
checksum = "b18cd2e169ad86297e6bc0ad9aa679aee9daa4f19e8163860faf7c164e4f5a71"
667+
dependencies = [
668+
"crossbeam-epoch 0.7.2",
669+
"crossbeam-utils 0.6.5",
670+
]
671+
662672
[[package]]
663673
name = "crossbeam-epoch"
664674
version = "0.3.1"
@@ -2791,22 +2801,22 @@ dependencies = [
27912801

27922802
[[package]]
27932803
name = "rayon"
2794-
version = "1.1.0"
2804+
version = "1.2.0"
27952805
source = "registry+https://github.com/rust-lang/crates.io-index"
2796-
checksum = "a4b0186e22767d5b9738a05eab7c6ac90b15db17e5b5f9bd87976dd7d89a10a4"
2806+
checksum = "83a27732a533a1be0a0035a111fe76db89ad312f6f0347004c220c57f209a123"
27972807
dependencies = [
2798-
"crossbeam-deque 0.6.3",
2808+
"crossbeam-deque 0.7.1",
27992809
"either",
28002810
"rayon-core",
28012811
]
28022812

28032813
[[package]]
28042814
name = "rayon-core"
2805-
version = "1.5.0"
2815+
version = "1.6.0"
28062816
source = "registry+https://github.com/rust-lang/crates.io-index"
2807-
checksum = "ebbe0df8435ac0c397d467b6cad6d25543d06e8a019ef3f6af3c384597515bd2"
2817+
checksum = "98dcf634205083b17d0861252431eb2acbfb698ab7478a2d20de07954f47ec7b"
28082818
dependencies = [
2809-
"crossbeam-deque 0.6.3",
2819+
"crossbeam-deque 0.7.1",
28102820
"crossbeam-queue",
28112821
"crossbeam-utils 0.6.5",
28122822
"lazy_static 1.3.0",
@@ -3074,8 +3084,8 @@ dependencies = [
30743084
"num_cpus",
30753085
"parking_lot 0.9.0",
30763086
"polonius-engine",
3077-
"rustc-rayon",
3078-
"rustc-rayon-core",
3087+
"rustc-rayon 0.3.0",
3088+
"rustc-rayon-core 0.3.0",
30793089
"rustc_apfloat",
30803090
"rustc_data_structures",
30813091
"rustc_errors",
@@ -3123,8 +3133,8 @@ dependencies = [
31233133
"rustc-ap-graphviz",
31243134
"rustc-ap-serialize",
31253135
"rustc-hash",
3126-
"rustc-rayon",
3127-
"rustc-rayon-core",
3136+
"rustc-rayon 0.2.0",
3137+
"rustc-rayon-core 0.2.0",
31283138
"smallvec",
31293139
"stable_deref_trait",
31303140
]
@@ -3263,7 +3273,18 @@ checksum = "0d2e07e19601f21c59aad953c2632172ba70cb27e685771514ea66e4062b3363"
32633273
dependencies = [
32643274
"crossbeam-deque 0.2.0",
32653275
"either",
3266-
"rustc-rayon-core",
3276+
"rustc-rayon-core 0.2.0",
3277+
]
3278+
3279+
[[package]]
3280+
name = "rustc-rayon"
3281+
version = "0.3.0"
3282+
source = "registry+https://github.com/rust-lang/crates.io-index"
3283+
checksum = "f32767f90d938f1b7199a174ef249ae1924f6e5bbdb9d112fea141e016f25b3a"
3284+
dependencies = [
3285+
"crossbeam-deque 0.7.1",
3286+
"either",
3287+
"rustc-rayon-core 0.3.0",
32673288
]
32683289

32693290
[[package]]
@@ -3278,6 +3299,19 @@ dependencies = [
32783299
"num_cpus",
32793300
]
32803301

3302+
[[package]]
3303+
name = "rustc-rayon-core"
3304+
version = "0.3.0"
3305+
source = "registry+https://github.com/rust-lang/crates.io-index"
3306+
checksum = "ea2427831f0053ea3ea73559c8eabd893133a51b251d142bacee53c62a288cb3"
3307+
dependencies = [
3308+
"crossbeam-deque 0.7.1",
3309+
"crossbeam-queue",
3310+
"crossbeam-utils 0.6.5",
3311+
"lazy_static 1.3.0",
3312+
"num_cpus",
3313+
]
3314+
32813315
[[package]]
32823316
name = "rustc-serialize"
32833317
version = "0.3.24"
@@ -3398,8 +3432,8 @@ dependencies = [
33983432
"log",
33993433
"parking_lot 0.9.0",
34003434
"rustc-hash",
3401-
"rustc-rayon",
3402-
"rustc-rayon-core",
3435+
"rustc-rayon 0.3.0",
3436+
"rustc-rayon-core 0.3.0",
34033437
"rustc_index",
34043438
"serialize",
34053439
"smallvec",
@@ -3479,7 +3513,7 @@ dependencies = [
34793513
"log",
34803514
"once_cell",
34813515
"rustc",
3482-
"rustc-rayon",
3516+
"rustc-rayon 0.3.0",
34833517
"rustc_codegen_ssa",
34843518
"rustc_codegen_utils",
34853519
"rustc_data_structures",
@@ -3758,7 +3792,7 @@ version = "0.0.0"
37583792
dependencies = [
37593793
"minifier",
37603794
"pulldown-cmark 0.5.3",
3761-
"rustc-rayon",
3795+
"rustc-rayon 0.3.0",
37623796
"tempfile",
37633797
]
37643798

src/librustc/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobserver = "0.1"
1818
num_cpus = "1.0"
1919
scoped-tls = "1.0"
2020
log = { version = "0.4", features = ["release_max_level_info", "std"] }
21-
rustc-rayon = "0.2.0"
22-
rustc-rayon-core = "0.2.0"
21+
rustc-rayon = "0.3.0"
22+
rustc-rayon-core = "0.3.0"
2323
polonius-engine = "0.10.0"
2424
rustc_apfloat = { path = "../librustc_apfloat" }
2525
rustc_target = { path = "../librustc_target" }

src/librustc_data_structures/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ graphviz = { path = "../libgraphviz" }
2020
cfg-if = "0.1.2"
2121
crossbeam-utils = { version = "0.6.5", features = ["nightly"] }
2222
stable_deref_trait = "1.0.0"
23-
rayon = { version = "0.2.0", package = "rustc-rayon" }
24-
rayon-core = { version = "0.2.0", package = "rustc-rayon-core" }
23+
rayon = { version = "0.3.0", package = "rustc-rayon" }
24+
rayon-core = { version = "0.3.0", package = "rustc-rayon-core" }
2525
rustc-hash = "1.0.1"
2626
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
2727
rustc_index = { path = "../librustc_index", package = "rustc_index" }

src/librustc_interface/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ doctest = false
1111

1212
[dependencies]
1313
log = "0.4"
14-
rayon = { version = "0.2.0", package = "rustc-rayon" }
14+
rayon = { version = "0.3.0", package = "rustc-rayon" }
1515
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
1616
syntax = { path = "../libsyntax" }
1717
syntax_ext = { path = "../libsyntax_ext" }

src/librustc_interface/util.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,12 @@ pub fn spawn_thread_pool<F: FnOnce() -> R + Send, R: Send>(
202202
stderr: &Option<Arc<Mutex<Vec<u8>>>>,
203203
f: F,
204204
) -> R {
205-
use rayon::{ThreadPool, ThreadPoolBuilder};
205+
use rayon::{ThreadBuilder, ThreadPool, ThreadPoolBuilder};
206206

207207
let gcx_ptr = &Lock::new(0);
208208

209209
let mut config = ThreadPoolBuilder::new()
210+
.thread_name(|_| "rustc".to_string())
210211
.acquire_thread_handler(jobserver::acquire_thread)
211212
.release_thread_handler(jobserver::release_thread)
212213
.num_threads(threads)
@@ -225,20 +226,20 @@ pub fn spawn_thread_pool<F: FnOnce() -> R + Send, R: Send>(
225226
// the thread local rustc uses. syntax_globals and syntax_pos_globals are
226227
// captured and set on the new threads. ty::tls::with_thread_locals sets up
227228
// thread local callbacks from libsyntax
228-
let main_handler = move |worker: &mut dyn FnMut()| {
229+
let main_handler = move |thread: ThreadBuilder| {
229230
syntax::GLOBALS.set(syntax_globals, || {
230231
syntax_pos::GLOBALS.set(syntax_pos_globals, || {
231232
if let Some(stderr) = stderr {
232233
io::set_panic(Some(box Sink(stderr.clone())));
233234
}
234235
ty::tls::with_thread_locals(|| {
235-
ty::tls::GCX_PTR.set(gcx_ptr, || worker())
236+
ty::tls::GCX_PTR.set(gcx_ptr, || thread.run())
236237
})
237238
})
238239
})
239240
};
240241

241-
ThreadPool::scoped_pool(config, main_handler, with_pool).unwrap()
242+
config.build_scoped(main_handler, with_pool).unwrap()
242243
})
243244
})
244245
})

src/librustdoc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ path = "lib.rs"
1111
[dependencies]
1212
pulldown-cmark = { version = "0.5.3", default-features = false }
1313
minifier = "0.0.33"
14-
rayon = { version = "0.2.0", package = "rustc-rayon" }
14+
rayon = { version = "0.3.0", package = "rustc-rayon" }
1515
tempfile = "3"

src/tools/tidy/src/deps.rs

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ const WHITELIST: &[Crate<'_>] = &[
8989
Crate("crc32fast"),
9090
Crate("crossbeam-deque"),
9191
Crate("crossbeam-epoch"),
92+
Crate("crossbeam-queue"),
9293
Crate("crossbeam-utils"),
9394
Crate("datafrog"),
9495
Crate("dlmalloc"),

0 commit comments

Comments
 (0)