diff --git a/compiler/rustc_query_system/src/dep_graph/graph.rs b/compiler/rustc_query_system/src/dep_graph/graph.rs index 076dcb4fed1..fefc8ed6f1a 100644 --- a/compiler/rustc_query_system/src/dep_graph/graph.rs +++ b/compiler/rustc_query_system/src/dep_graph/graph.rs @@ -242,7 +242,6 @@ pub fn with_task, A, R>( key, cx, arg, - false, task, |_key| { Some(TaskDeps { @@ -262,29 +261,16 @@ fn with_task_impl, A, R>( key: DepNode, cx: Ctxt, arg: A, - no_tcx: bool, task: fn(Ctxt, A) -> R, create_task: fn(DepNode) -> Option>, hash_result: impl FnOnce(&mut Ctxt::StableHashingContext, &R) -> Option, ) -> (R, DepNodeIndex) { if let Some(ref data) = self.data { let task_deps = create_task(key).map(Lock::new); - - // In incremental mode, hash the result of the task. We don't - // do anything with the hash yet, but we are computing it - // anyway so that - // - we make sure that the infrastructure works and - // - we can get an idea of the runtime cost. - let mut hcx = cx.create_stable_hashing_context(); - - let result = if no_tcx { - task(cx, arg) - } else { - K::with_deps(task_deps.as_ref(), || task(cx, arg)) - }; - + let result = K::with_deps(task_deps.as_ref(), || task(cx, arg)); let edges = task_deps.map_or_else(|| smallvec![], |lock| lock.into_inner().reads); + let mut hcx = cx.create_stable_hashing_context(); let current_fingerprint = hash_result(&mut hcx, &result); let print_status = cfg!(debug_assertions) && cx.debug_dep_tasks(); @@ -413,7 +399,7 @@ pub fn with_eval_always_task, A, R>( task: fn(Ctxt, A) -> R, hash_result: impl FnOnce(&mut Ctxt::StableHashingContext, &R) -> Option, ) -> (R, DepNodeIndex) { - self.with_task_impl(key, cx, arg, false, task, |_| None, hash_result) + self.with_task_impl(key, cx, arg, task, |_| None, hash_result) } #[inline]