@@ -23,7 +23,7 @@ use {super::debug::EdgeFilter, std::env};
2323
2424use super :: query:: DepGraphQuery ;
2525use super :: serialized:: { GraphEncoder , SerializedDepGraph , SerializedDepNodeIndex } ;
26- use super :: { DepContext , DepKind , DepNode , Deps , HasDepContext , WorkProductId } ;
26+ use super :: { DepContext , DepKind , DepNode , Deps , WorkProductId } ;
2727use crate :: dep_graph:: edges:: EdgesVec ;
2828use crate :: ich:: StableHashingContext ;
2929use crate :: query:: { QueryContext , QuerySideEffect } ;
@@ -260,7 +260,7 @@ impl<D: Deps> DepGraph<D> {
260260 }
261261
262262 #[ inline( always) ]
263- pub fn with_task < Ctxt : HasDepContext < Deps = D > , A : Debug , R > (
263+ pub fn with_task < Ctxt : DepContext < Deps = D > , A : Debug , R > (
264264 & self ,
265265 key : DepNode ,
266266 cx : Ctxt ,
@@ -269,7 +269,7 @@ impl<D: Deps> DepGraph<D> {
269269 hash_result : Option < fn ( & mut StableHashingContext < ' _ > , & R ) -> Fingerprint > ,
270270 ) -> ( R , DepNodeIndex ) {
271271 match self . data ( ) {
272- Some ( data) => data. with_task ( key, cx, arg, task, hash_result) ,
272+ Some ( data) => data. with_task ( key, cx, cx , arg, task, hash_result) ,
273273 None => ( task ( cx, arg) , self . next_virtual_depnode_index ( ) ) ,
274274 }
275275 }
@@ -323,12 +323,13 @@ impl<D: Deps> DepGraphData<D> {
323323 ///
324324 /// [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/queries/incremental-compilation.html
325325 #[ inline( always) ]
326- pub ( crate ) fn with_task < Ctxt : HasDepContext < Deps = D > , A : Debug , R > (
326+ pub ( crate ) fn with_task < Ctxt : DepContext < Deps = D > , A : Debug , C : Copy , R > (
327327 & self ,
328328 key : DepNode ,
329329 cx : Ctxt ,
330+ task_context : C ,
330331 arg : A ,
331- task : fn ( Ctxt , A ) -> R ,
332+ task : fn ( C , A ) -> R ,
332333 hash_result : Option < fn ( & mut StableHashingContext < ' _ > , & R ) -> Fingerprint > ,
333334 ) -> ( R , DepNodeIndex ) {
334335 // If the following assertion triggers, it can have two reasons:
@@ -344,8 +345,8 @@ impl<D: Deps> DepGraphData<D> {
344345 )
345346 } ) ;
346347
347- let with_deps = |task_deps| D :: with_deps ( task_deps, || task ( cx , arg) ) ;
348- let ( result, edges) = if cx. dep_context ( ) . is_eval_always ( key. kind ) {
348+ let with_deps = |task_deps| D :: with_deps ( task_deps, || task ( task_context , arg) ) ;
349+ let ( result, edges) = if cx. is_eval_always ( key. kind ) {
349350 ( with_deps ( TaskDepsRef :: EvalAlways ) , EdgesVec :: new ( ) )
350351 } else {
351352 let task_deps = Lock :: new ( TaskDeps :: new (
@@ -356,8 +357,7 @@ impl<D: Deps> DepGraphData<D> {
356357 ( with_deps ( TaskDepsRef :: Allow ( & task_deps) ) , task_deps. into_inner ( ) . reads )
357358 } ;
358359
359- let dcx = cx. dep_context ( ) ;
360- let dep_node_index = self . hash_result_and_alloc_node ( dcx, key, edges, & result, hash_result) ;
360+ let dep_node_index = self . hash_result_and_alloc_node ( cx, key, edges, & result, hash_result) ;
361361
362362 ( result, dep_node_index)
363363 }
@@ -444,7 +444,7 @@ impl<D: Deps> DepGraphData<D> {
444444 /// Intern the new `DepNode` with the dependencies up-to-now.
445445 fn hash_result_and_alloc_node < Ctxt : DepContext < Deps = D > , R > (
446446 & self ,
447- cx : & Ctxt ,
447+ cx : Ctxt ,
448448 node : DepNode ,
449449 edges : EdgesVec ,
450450 result : & R ,
@@ -613,7 +613,7 @@ impl<D: Deps> DepGraph<D> {
613613 }
614614 } ) ;
615615
616- data. hash_result_and_alloc_node ( & cx, node, edges, result, hash_result)
616+ data. hash_result_and_alloc_node ( cx, node, edges, result, hash_result)
617617 } else {
618618 // Incremental compilation is turned off. We just execute the task
619619 // without tracking. We still provide a dep-node index that uniquely
0 commit comments