Skip to content

Commit 3a8bb20

Browse files
committed
Remove assert_ignored and with_ignore_deps.
1 parent 2326ae3 commit 3a8bb20

File tree

3 files changed

+4
-28
lines changed

3 files changed

+4
-28
lines changed

src/librustc/dep_graph/mod.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,6 @@ impl rustc_query_system::dep_graph::DepKind for DepKind {
6262
write!(f, ")")
6363
}
6464

65-
fn assert_ignored() {
66-
ty::tls::with_context_opt(|icx| {
67-
let icx = if let Some(icx) = icx { icx } else { return };
68-
assert!(icx.task_deps.is_none(), "expected no task dependency tracking");
69-
})
70-
}
71-
72-
fn with_ignore_deps<OP, R>(op: OP) -> R
73-
where
74-
OP: FnOnce() -> R,
75-
{
76-
ty::tls::with_context(|icx| {
77-
let icx = ty::tls::ImplicitCtxt { task_deps: None, ..icx.clone() };
78-
79-
ty::tls::enter_context(&icx, |_| op())
80-
})
81-
}
82-
8365
fn with_deps<OP, R>(task_deps: Option<&Lock<TaskDeps>>, op: OP) -> R
8466
where
8567
OP: FnOnce() -> R,

src/librustc_query_system/dep_graph/graph.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,17 @@ impl<K: DepKind> DepGraph<K> {
151151

152152
pub fn assert_ignored(&self) {
153153
if let Some(..) = self.data {
154-
K::assert_ignored();
154+
K::read_deps(|task_deps| {
155+
assert!(task_deps.is_none(), "expected no task dependency tracking");
156+
})
155157
}
156158
}
157159

158160
pub fn with_ignore<OP, R>(&self, op: OP) -> R
159161
where
160162
OP: FnOnce() -> R,
161163
{
162-
K::with_ignore_deps(op)
164+
K::with_deps(None, op)
163165
}
164166

165167
/// Starts a new dep-graph task. Dep-graph tasks are specified

src/librustc_query_system/dep_graph/mod.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,6 @@ pub trait DepKind: Copy + fmt::Debug + Eq + Ord + Hash {
7676
/// Implementation of `std::fmt::Debug` for `DepNode`.
7777
fn debug_node(node: &DepNode<Self>, f: &mut fmt::Formatter<'_>) -> fmt::Result;
7878

79-
/// Assert the current implicit context does not track any dependency.
80-
fn assert_ignored();
81-
82-
/// Execute the operation ignoring the dependencies.
83-
fn with_ignore_deps<OP, R>(op: OP) -> R
84-
where
85-
OP: FnOnce() -> R;
86-
8779
/// Execute the operation with provided dependencies.
8880
fn with_deps<OP, R>(deps: Option<&Lock<TaskDeps<Self>>>, op: OP) -> R
8981
where

0 commit comments

Comments
 (0)