Skip to content

Commit add456b

Browse files
committed
use rayon_core::tlv
1 parent dc3be9f commit add456b

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

compiler/rustc_data_structures/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ jobserver_crate = { version = "0.1.13", package = "jobserver" }
1515
libc = "0.2"
1616
measureme = "10.0.0"
1717
rustc-rayon-core = { version = "0.5.0" }
18-
rustc-rayon = { version = "0.5.0", optional = true }rustc_graphviz = { path = "../rustc_graphviz" }
18+
rustc-rayon = { version = "0.5.0", optional = true }
19+
rustc_graphviz = { path = "../rustc_graphviz" }
1920
rustc-hash = "1.1.0"
2021
rustc_index = { path = "../rustc_index", package = "rustc_index" }
2122
rustc_macros = { path = "../rustc_macros" }

compiler/rustc_middle/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ rustc_hir = { path = "../rustc_hir" }
2727
rustc_index = { path = "../rustc_index" }
2828
rustc_macros = { path = "../rustc_macros" }
2929
rustc_query_system = { path = "../rustc_query_system" }
30-
rustc-rayon-core = { version = "0.5.0", optional = true }
30+
rustc-rayon-core = { version = "0.5.0" }
3131
rustc-rayon = { version = "0.5.0", optional = true }
3232
rustc_serialize = { path = "../rustc_serialize" }
3333
rustc_session = { path = "../rustc_session" }
@@ -39,4 +39,4 @@ thin-vec = "0.2.12"
3939
tracing = "0.1"
4040

4141
[features]
42-
rustc_use_parallel_compiler = ["rustc-rayon", "rustc-rayon-core"]
42+
rustc_use_parallel_compiler = ["rustc-rayon"]

compiler/rustc_middle/src/ty/context/tls.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ use crate::dep_graph::TaskDepsRef;
44
use crate::ty::query;
55
use rustc_data_structures::sync::{self, Lock};
66
use rustc_errors::Diagnostic;
7-
#[cfg(not(parallel_compiler))]
8-
use std::cell::Cell;
97
use std::mem;
108
use std::ptr;
119
use thin_vec::ThinVec;
@@ -49,17 +47,8 @@ impl<'a, 'tcx> ImplicitCtxt<'a, 'tcx> {
4947
}
5048
}
5149

52-
// Import the thread-local variable from Rayon, which is preserved for Rayon jobs.
53-
#[cfg(parallel_compiler)]
5450
use rayon_core::tlv::TLV;
5551

56-
// Otherwise define our own
57-
#[cfg(not(parallel_compiler))]
58-
thread_local! {
59-
/// A thread local variable that stores a pointer to the current `ImplicitCtxt`.
60-
static TLV: Cell<*const ()> = const { Cell::new(ptr::null()) };
61-
}
62-
6352
#[inline]
6453
fn erase(context: &ImplicitCtxt<'_, '_>) -> *const () {
6554
context as *const _ as *const ()

0 commit comments

Comments
 (0)