File tree 1 file changed +7
-4
lines changed
compiler/rustc_data_structures/src/graph/scc
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -535,7 +535,6 @@ where
535
535
successors_len: 0 ,
536
536
min_cycle_root: initial,
537
537
successor_node: initial,
538
- // Strictly speaking not necessary, but assumed to be idempotent:
539
538
current_component_annotation: ( self . to_annotation) ( initial) ,
540
539
} ] ;
541
540
@@ -556,7 +555,9 @@ where
556
555
let depth = * depth;
557
556
558
557
// node is definitely in the current component, add it to the annotation.
559
- current_component_annotation. update_scc ( ( self . to_annotation ) ( node) ) ;
558
+ if node != initial {
559
+ current_component_annotation. update_scc ( ( self . to_annotation ) ( node) ) ;
560
+ }
560
561
debug ! (
561
562
"Visiting {node:?} at depth {depth:?}, annotation: {current_component_annotation:?}"
562
563
) ;
@@ -570,8 +571,10 @@ where
570
571
debug_assert ! ( matches!( self . node_states[ node] , NodeState :: NotVisited ) ) ;
571
572
572
573
// Push `node` onto the stack.
573
- self . node_states [ node] =
574
- NodeState :: BeingVisited { depth, annotation : ( self . to_annotation ) ( node) } ;
574
+ self . node_states [ node] = NodeState :: BeingVisited {
575
+ depth,
576
+ annotation : * current_component_annotation,
577
+ } ;
575
578
self . node_stack . push ( node) ;
576
579
577
580
// Walk each successor of the node, looking to see if any of
You can’t perform that action at this time.
0 commit comments