Skip to content

Commit 2738f2c

Browse files
committed
Address comments
1 parent 18d6b37 commit 2738f2c

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

src/librustc/dep_graph/graph.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ impl DepGraph {
189189
reads: SmallVec::new(),
190190
read_set: Default::default(),
191191
})),
192-
|data, key, f, task| data.borrow_mut().complete_task(key, task, f))
192+
|data, key, fingerprint, task| data.borrow_mut().complete_task(key, task, fingerprint))
193193
}
194194

195195
/// Creates a new dep-graph input with value `input`
@@ -207,7 +207,9 @@ impl DepGraph {
207207

208208
self.with_task_impl(key, cx, input, true, identity_fn,
209209
|_| OpenTask::Ignore,
210-
|data, key, f, _| data.borrow_mut().alloc_node(key, SmallVec::new(), f))
210+
|data, key, fingerprint, _| {
211+
data.borrow_mut().alloc_node(key, SmallVec::new(), fingerprint)
212+
})
211213
}
212214

213215
fn with_task_impl<'gcx, C, A, R>(
@@ -343,7 +345,9 @@ impl DepGraph {
343345
{
344346
self.with_task_impl(key, cx, arg, false, task,
345347
|key| OpenTask::EvalAlways { node: key },
346-
|data, key, f, task| data.borrow_mut().complete_eval_always_task(key, task, f))
348+
|data, key, fingerprint, task| {
349+
data.borrow_mut().complete_eval_always_task(key, task, fingerprint)
350+
})
347351
}
348352

349353
#[inline]

src/librustc/hir/map/collector.rs

+7-9
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ pub(super) struct NodeCollector<'a, 'hir> {
4747
fn input_dep_node_and_hash<'a, I>(
4848
dep_graph: &DepGraph,
4949
hcx: &mut StableHashingContext<'a>,
50-
def_node: DepNode,
50+
dep_node: DepNode,
5151
input: I,
5252
) -> (DepNodeIndex, Fingerprint)
5353
where
5454
I: HashStable<StableHashingContext<'a>>,
5555
{
56-
let dep_node_index = dep_graph.input_task(def_node, &mut *hcx, &input).1;
56+
let dep_node_index = dep_graph.input_task(dep_node, &mut *hcx, &input).1;
5757

5858
let hash = if dep_graph.is_fully_enabled() {
5959
dep_graph.fingerprint_of(dep_node_index)
@@ -66,7 +66,7 @@ where
6666
(dep_node_index, hash)
6767
}
6868

69-
fn hir_dep_nodes<'a, I>(
69+
fn alloc_hir_dep_nodes<'a, I>(
7070
dep_graph: &DepGraph,
7171
hcx: &mut StableHashingContext<'a>,
7272
def_path_hash: DefPathHash,
@@ -121,7 +121,7 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
121121
body_ids: _,
122122
} = *krate;
123123

124-
hir_dep_nodes(
124+
alloc_hir_dep_nodes(
125125
dep_graph,
126126
&mut hcx,
127127
root_mod_def_path_hash,
@@ -172,10 +172,8 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
172172
let node_hashes = self
173173
.hir_body_nodes
174174
.iter()
175-
.fold(Fingerprint::ZERO, |fingerprint, &(def_path_hash, hash)| {
176-
fingerprint.combine(
177-
def_path_hash.0.combine(hash)
178-
)
175+
.fold(Fingerprint::ZERO, |combined_fingerprint, &(def_path_hash, fingerprint)| {
176+
combined_fingerprint.combine(def_path_hash.0.combine(fingerprint))
179177
});
180178

181179
let mut upstream_crates: Vec<_> = cstore.crates_untracked().iter().map(|&cnum| {
@@ -296,7 +294,7 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
296294

297295
let def_path_hash = self.definitions.def_path_hash(dep_node_owner);
298296

299-
let (signature_dep_index, full_dep_index) = hir_dep_nodes(
297+
let (signature_dep_index, full_dep_index) = alloc_hir_dep_nodes(
300298
self.dep_graph,
301299
&mut self.hcx,
302300
def_path_hash,

0 commit comments

Comments
 (0)