Skip to content

Commit 33c4125

Browse files
committed
Rebase rustc-rayon on rayon-1.2
See also rust-lang/rustc-rayon#3
1 parent 59a31c8 commit 33c4125

File tree

6 files changed

+53
-19
lines changed

6 files changed

+53
-19
lines changed

Cargo.lock

+43-9
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"
@@ -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

+4-4
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ 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

@@ -225,20 +225,20 @@ pub fn spawn_thread_pool<F: FnOnce() -> R + Send, R: Send>(
225225
// the thread local rustc uses. syntax_globals and syntax_pos_globals are
226226
// captured and set on the new threads. ty::tls::with_thread_locals sets up
227227
// thread local callbacks from libsyntax
228-
let main_handler = move |worker: &mut dyn FnMut()| {
228+
let main_handler = move |thread: ThreadBuilder| {
229229
syntax::GLOBALS.set(syntax_globals, || {
230230
syntax_pos::GLOBALS.set(syntax_pos_globals, || {
231231
if let Some(stderr) = stderr {
232232
io::set_panic(Some(box Sink(stderr.clone())));
233233
}
234234
ty::tls::with_thread_locals(|| {
235-
ty::tls::GCX_PTR.set(gcx_ptr, || worker())
235+
ty::tls::GCX_PTR.set(gcx_ptr, || thread.run())
236236
})
237237
})
238238
})
239239
};
240240

241-
ThreadPool::scoped_pool(config, main_handler, with_pool).unwrap()
241+
config.build_scoped(main_handler, with_pool).unwrap()
242242
})
243243
})
244244
})

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"

0 commit comments

Comments
 (0)