@@ -346,7 +346,7 @@ impl<D: Deps> DepGraphData<D> {
346346 task : fn ( Ctxt , A ) -> R ,
347347 hash_result : Option < fn ( & mut StableHashingContext < ' _ > , & R ) -> Fingerprint > ,
348348 ) -> ( R , DepNodeIndex ) {
349- self . assert_nonexistent_node ( & key, || {
349+ self . assert_nonexistent_node ( key, || {
350350 format ! (
351351 "forcing query with already existing `DepNode`\n \
352352 - query-key: {arg:?}\n \
@@ -356,7 +356,7 @@ impl<D: Deps> DepGraphData<D> {
356356
357357 let with_deps = |task_deps| D :: with_deps ( task_deps, || task ( cx, arg) ) ;
358358 let ( result, edges) = if cx. dep_context ( ) . is_eval_always ( key. kind ) {
359- ( with_deps ( TaskDepsRef :: EvalAlways ) , EdgesVec :: new ( ) )
359+ ( with_deps ( TaskDepsRef :: EvalAlways ) , EdgesVec :: eval_always ( ) )
360360 } else {
361361 let task_deps = Lock :: new ( TaskDeps {
362362 #[ cfg( debug_assertions) ]
@@ -630,12 +630,12 @@ impl<D: Deps> DepGraph<D> {
630630impl < D : Deps > DepGraphData < D > {
631631 fn assert_nonexistent_node < S : std:: fmt:: Display > (
632632 & self ,
633- _dep_node : & DepNode ,
633+ _dep_node : DepNode ,
634634 _msg : impl FnOnce ( ) -> S ,
635635 ) {
636636 #[ cfg( debug_assertions) ]
637637 if let Some ( seen_dep_nodes) = & self . current . seen_dep_nodes {
638- let seen = seen_dep_nodes. lock ( ) . contains ( _dep_node) ;
638+ let seen = seen_dep_nodes. lock ( ) . contains ( & _dep_node) ;
639639 assert ! ( !seen, "{}" , _msg( ) ) ;
640640 }
641641 }
@@ -748,7 +748,7 @@ impl<D: Deps> DepGraphData<D> {
748748 // in the previous compilation session too, so we can try to
749749 // mark it as green by recursively marking all of its
750750 // dependencies green.
751- self . try_mark_previous_green ( qcx, prev_index, dep_node , None )
751+ self . try_mark_previous_green ( qcx, prev_index, None )
752752 . map ( |dep_node_index| ( prev_index, dep_node_index) )
753753 }
754754 }
@@ -762,47 +762,40 @@ impl<D: Deps> DepGraphData<D> {
762762 frame : Option < & MarkFrame < ' _ > > ,
763763 ) -> Option < ( ) > {
764764 let dep_dep_node_color = self . colors . get ( parent_dep_node_index) ;
765- let dep_dep_node = & self . previous . index_to_node ( parent_dep_node_index) ;
765+ let dep_dep_node = || self . previous . index_to_node ( parent_dep_node_index) ;
766766
767767 match dep_dep_node_color {
768768 Some ( DepNodeColor :: Green ( _) ) => {
769769 // This dependency has been marked as green before, we are
770770 // still fine and can continue with checking the other
771771 // dependencies.
772- debug ! ( "dependency {dep_dep_node :?} was immediately green" ) ;
772+ debug ! ( "dependency {:?} was immediately green" , dep_dep_node ( ) ) ;
773773 return Some ( ( ) ) ;
774774 }
775775 Some ( DepNodeColor :: Red ) => {
776776 // We found a dependency the value of which has changed
777777 // compared to the previous compilation session. We cannot
778778 // mark the DepNode as green and also don't need to bother
779779 // with checking any of the other dependencies.
780- debug ! ( "dependency {dep_dep_node :?} was immediately red" ) ;
780+ debug ! ( "dependency {:?} was immediately red" , dep_dep_node ( ) ) ;
781781 return None ;
782782 }
783783 None => { }
784784 }
785785
786- // We don't know the state of this dependency. If it isn't
787- // an eval_always node, let's try to mark it green recursively.
788- if !qcx. dep_context ( ) . is_eval_always ( dep_dep_node. kind ) {
789- debug ! (
790- "state of dependency {:?} ({}) is unknown, trying to mark it green" ,
791- dep_dep_node, dep_dep_node. hash,
792- ) ;
793-
794- let node_index =
795- self . try_mark_previous_green ( qcx, parent_dep_node_index, dep_dep_node, frame) ;
786+ // We don't know the state of this dependency. Let's try to mark it green recursively.
787+ debug ! ( "state of dependency {:?} is unknown, trying to mark it green" , dep_dep_node( ) ) ;
788+ let node_index = self . try_mark_previous_green ( qcx, parent_dep_node_index, frame) ;
796789
797- if node_index. is_some ( ) {
798- debug ! ( "managed to MARK dependency {dep_dep_node:?} as green" , ) ;
799- return Some ( ( ) ) ;
800- }
790+ if node_index. is_some ( ) {
791+ debug ! ( "managed to MARK dependency {:?} as green" , dep_dep_node( ) ) ;
792+ return Some ( ( ) ) ;
801793 }
802794
803795 // We failed to mark it green, so we try to force the query.
796+ let dep_dep_node = dep_dep_node ( ) ;
804797 debug ! ( "trying to force dependency {dep_dep_node:?}" ) ;
805- if !qcx. dep_context ( ) . try_force_from_dep_node ( * dep_dep_node, frame) {
798+ if !qcx. dep_context ( ) . try_force_from_dep_node ( dep_dep_node, frame) {
806799 // The DepNode could not be forced.
807800 debug ! ( "dependency {dep_dep_node:?} could not be forced" ) ;
808801 return None ;
@@ -846,15 +839,10 @@ impl<D: Deps> DepGraphData<D> {
846839 & self ,
847840 qcx : Qcx ,
848841 prev_dep_node_index : SerializedDepNodeIndex ,
849- dep_node : & DepNode ,
850842 frame : Option < & MarkFrame < ' _ > > ,
851843 ) -> Option < DepNodeIndex > {
852844 let frame = MarkFrame { index : prev_dep_node_index, parent : frame } ;
853-
854- // We never try to mark eval_always nodes as green
855- debug_assert ! ( !qcx. dep_context( ) . is_eval_always( dep_node. kind) ) ;
856-
857- debug_assert_eq ! ( self . previous. index_to_node( prev_dep_node_index) , * dep_node) ;
845+ let dep_node = || self . previous . index_to_node ( prev_dep_node_index) ;
858846
859847 let prev_deps = self . previous . edge_targets_from ( prev_dep_node_index) ;
860848
@@ -889,7 +877,7 @@ impl<D: Deps> DepGraphData<D> {
889877 // Multiple threads can all write the same color here
890878 self . colors . insert ( prev_dep_node_index, DepNodeColor :: Green ( dep_node_index) ) ;
891879
892- debug ! ( "successfully marked {dep_node :?} as green" ) ;
880+ debug ! ( "successfully marked {:?} as green" , dep_node ( ) ) ;
893881 Some ( dep_node_index)
894882 }
895883
@@ -936,7 +924,7 @@ impl<D: Deps> DepGraph<D> {
936924
937925 pub fn assert_nonexistent_node < S : std:: fmt:: Display > (
938926 & self ,
939- dep_node : & DepNode ,
927+ dep_node : DepNode ,
940928 msg : impl FnOnce ( ) -> S ,
941929 ) {
942930 if cfg ! ( debug_assertions)
0 commit comments