Skip to content

Commit 8ec629b

Browse files
committed
Address comments
1 parent 64b5d40 commit 8ec629b

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

src/librustc/dep_graph/graph.rs

+18-16
Original file line numberDiff line numberDiff line change
@@ -233,22 +233,24 @@ impl DepGraph {
233233
|data, key, _| data.borrow_mut().alloc_node(key, Vec::new()))
234234
}
235235

236-
fn with_task_impl<'gcx, C, A, R>(&self,
237-
key: DepNode,
238-
cx: C,
239-
arg: A,
240-
no_tcx: bool,
241-
task: fn(C, A) -> R,
242-
get_task: fn(DepNode) -> OpenTask,
243-
get_index: fn(&Lock<CurrentDepGraph>,
244-
DepNode,
245-
OpenTask) -> DepNodeIndex)
246-
-> (R, DepNodeIndex)
247-
where C: DepGraphSafe + StableHashingContextProvider<'gcx>,
248-
R: HashStable<StableHashingContext<'gcx>>,
236+
fn with_task_impl<'gcx, C, A, R>(
237+
&self,
238+
key: DepNode,
239+
cx: C,
240+
arg: A,
241+
no_tcx: bool,
242+
task: fn(C, A) -> R,
243+
create_task: fn(DepNode) -> OpenTask,
244+
finish_task_and_alloc_depnode: fn(&Lock<CurrentDepGraph>,
245+
DepNode,
246+
OpenTask) -> DepNodeIndex
247+
) -> (R, DepNodeIndex)
248+
where
249+
C: DepGraphSafe + StableHashingContextProvider<'gcx>,
250+
R: HashStable<StableHashingContext<'gcx>>,
249251
{
250252
if let Some(ref data) = self.data {
251-
let open_task = get_task(key);
253+
let open_task = create_task(key);
252254

253255
// In incremental mode, hash the result of the task. We don't
254256
// do anything with the hash yet, but we are computing it
@@ -286,7 +288,7 @@ impl DepGraph {
286288
profq_msg(hcx.sess(), ProfileQueriesMsg::TaskEnd)
287289
};
288290

289-
let dep_node_index = get_index(&data.current, key, open_task);
291+
let dep_node_index = finish_task_and_alloc_depnode(&data.current, key, open_task);
290292

291293
let mut stable_hasher = StableHasher::new();
292294
result.hash_stable(&mut hcx, &mut stable_hasher);
@@ -983,7 +985,7 @@ impl CurrentDepGraph {
983985
}
984986
}
985987

986-
pub(super) fn complete_task(&mut self, key: DepNode, task: OpenTask) -> DepNodeIndex {
988+
fn complete_task(&mut self, key: DepNode, task: OpenTask) -> DepNodeIndex {
987989
if let OpenTask::Regular {
988990
node,
989991
read_set: _,

0 commit comments

Comments
 (0)