diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2020-03-21 00:27:09 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2020-03-23 23:15:51 +0100 |
| commit | 3a8bb20230c4bb8f40aeca1d6ca3dea048b9e2e3 (patch) | |
| tree | 057e4ef97d00a4c1eee0bb8443a433d6907b70ac | |
| parent | 2326ae39b262169fa853c510aa1bc795a166dc26 (diff) | |
| download | rust-3a8bb20230c4bb8f40aeca1d6ca3dea048b9e2e3.tar.gz rust-3a8bb20230c4bb8f40aeca1d6ca3dea048b9e2e3.zip | |
Remove assert_ignored and with_ignore_deps.
| -rw-r--r-- | src/librustc/dep_graph/mod.rs | 18 | ||||
| -rw-r--r-- | src/librustc_query_system/dep_graph/graph.rs | 6 | ||||
| -rw-r--r-- | src/librustc_query_system/dep_graph/mod.rs | 8 |
3 files changed, 4 insertions, 28 deletions
diff --git a/src/librustc/dep_graph/mod.rs b/src/librustc/dep_graph/mod.rs index d739223f6cb..5ccc0d281db 100644 --- a/src/librustc/dep_graph/mod.rs +++ b/src/librustc/dep_graph/mod.rs @@ -62,24 +62,6 @@ impl rustc_query_system::dep_graph::DepKind for DepKind { write!(f, ")") } - fn assert_ignored() { - ty::tls::with_context_opt(|icx| { - let icx = if let Some(icx) = icx { icx } else { return }; - assert!(icx.task_deps.is_none(), "expected no task dependency tracking"); - }) - } - - fn with_ignore_deps<OP, R>(op: OP) -> R - where - OP: FnOnce() -> R, - { - ty::tls::with_context(|icx| { - let icx = ty::tls::ImplicitCtxt { task_deps: None, ..icx.clone() }; - - ty::tls::enter_context(&icx, |_| op()) - }) - } - fn with_deps<OP, R>(task_deps: Option<&Lock<TaskDeps>>, op: OP) -> R where OP: FnOnce() -> R, diff --git a/src/librustc_query_system/dep_graph/graph.rs b/src/librustc_query_system/dep_graph/graph.rs index 36edf255a77..c012dc687d7 100644 --- a/src/librustc_query_system/dep_graph/graph.rs +++ b/src/librustc_query_system/dep_graph/graph.rs @@ -151,7 +151,9 @@ impl<K: DepKind> DepGraph<K> { pub fn assert_ignored(&self) { if let Some(..) = self.data { - K::assert_ignored(); + K::read_deps(|task_deps| { + assert!(task_deps.is_none(), "expected no task dependency tracking"); + }) } } @@ -159,7 +161,7 @@ impl<K: DepKind> DepGraph<K> { where OP: FnOnce() -> R, { - K::with_ignore_deps(op) + K::with_deps(None, op) } /// Starts a new dep-graph task. Dep-graph tasks are specified diff --git a/src/librustc_query_system/dep_graph/mod.rs b/src/librustc_query_system/dep_graph/mod.rs index c9983013d38..e6a927c11dd 100644 --- a/src/librustc_query_system/dep_graph/mod.rs +++ b/src/librustc_query_system/dep_graph/mod.rs @@ -76,14 +76,6 @@ pub trait DepKind: Copy + fmt::Debug + Eq + Ord + Hash { /// Implementation of `std::fmt::Debug` for `DepNode`. fn debug_node(node: &DepNode<Self>, f: &mut fmt::Formatter<'_>) -> fmt::Result; - /// Assert the current implicit context does not track any dependency. - fn assert_ignored(); - - /// Execute the operation ignoring the dependencies. - fn with_ignore_deps<OP, R>(op: OP) -> R - where - OP: FnOnce() -> R; - /// Execute the operation with provided dependencies. fn with_deps<OP, R>(deps: Option<&Lock<TaskDeps<Self>>>, op: OP) -> R where |
