@@ -573,10 +573,10 @@ impl<K: DepKind> DepGraph<K> {
573
573
/// a node index can be found for that node.
574
574
pub fn try_mark_green < Ctxt : QueryContext < DepKind = K > > (
575
575
& self ,
576
- tcx : Ctxt ,
576
+ qcx : Ctxt ,
577
577
dep_node : & DepNode < K > ,
578
578
) -> Option < ( SerializedDepNodeIndex , DepNodeIndex ) > {
579
- debug_assert ! ( !tcx . dep_context( ) . is_eval_always( dep_node. kind) ) ;
579
+ debug_assert ! ( !qcx . dep_context( ) . is_eval_always( dep_node. kind) ) ;
580
580
581
581
// Return None if the dep graph is disabled
582
582
let data = self . data . as_ref ( ) ?;
@@ -592,16 +592,16 @@ impl<K: DepKind> DepGraph<K> {
592
592
// in the previous compilation session too, so we can try to
593
593
// mark it as green by recursively marking all of its
594
594
// dependencies green.
595
- self . try_mark_previous_green ( tcx , data, prev_index, & dep_node)
595
+ self . try_mark_previous_green ( qcx , data, prev_index, & dep_node)
596
596
. map ( |dep_node_index| ( prev_index, dep_node_index) )
597
597
}
598
598
}
599
599
}
600
600
601
- #[ instrument( skip( self , tcx , data, parent_dep_node_index) , level = "debug" ) ]
601
+ #[ instrument( skip( self , qcx , data, parent_dep_node_index) , level = "debug" ) ]
602
602
fn try_mark_parent_green < Ctxt : QueryContext < DepKind = K > > (
603
603
& self ,
604
- tcx : Ctxt ,
604
+ qcx : Ctxt ,
605
605
data : & DepGraphData < K > ,
606
606
parent_dep_node_index : SerializedDepNodeIndex ,
607
607
dep_node : & DepNode < K > ,
@@ -630,14 +630,14 @@ impl<K: DepKind> DepGraph<K> {
630
630
631
631
// We don't know the state of this dependency. If it isn't
632
632
// an eval_always node, let's try to mark it green recursively.
633
- if !tcx . dep_context ( ) . is_eval_always ( dep_dep_node. kind ) {
633
+ if !qcx . dep_context ( ) . is_eval_always ( dep_dep_node. kind ) {
634
634
debug ! (
635
635
"state of dependency {:?} ({}) is unknown, trying to mark it green" ,
636
636
dep_dep_node, dep_dep_node. hash,
637
637
) ;
638
638
639
639
let node_index =
640
- self . try_mark_previous_green ( tcx , data, parent_dep_node_index, dep_dep_node) ;
640
+ self . try_mark_previous_green ( qcx , data, parent_dep_node_index, dep_dep_node) ;
641
641
642
642
if node_index. is_some ( ) {
643
643
debug ! ( "managed to MARK dependency {dep_dep_node:?} as green" , ) ;
@@ -647,7 +647,7 @@ impl<K: DepKind> DepGraph<K> {
647
647
648
648
// We failed to mark it green, so we try to force the query.
649
649
debug ! ( "trying to force dependency {dep_dep_node:?}" ) ;
650
- if !tcx . dep_context ( ) . try_force_from_dep_node ( * dep_dep_node) {
650
+ if !qcx . dep_context ( ) . try_force_from_dep_node ( * dep_dep_node) {
651
651
// The DepNode could not be forced.
652
652
debug ! ( "dependency {dep_dep_node:?} could not be forced" ) ;
653
653
return None ;
@@ -667,7 +667,7 @@ impl<K: DepKind> DepGraph<K> {
667
667
None => { }
668
668
}
669
669
670
- if !tcx . dep_context ( ) . sess ( ) . has_errors_or_delayed_span_bugs ( ) {
670
+ if !qcx . dep_context ( ) . sess ( ) . has_errors_or_delayed_span_bugs ( ) {
671
671
panic ! ( "try_mark_previous_green() - Forcing the DepNode should have set its color" )
672
672
}
673
673
@@ -686,10 +686,10 @@ impl<K: DepKind> DepGraph<K> {
686
686
}
687
687
688
688
/// Try to mark a dep-node which existed in the previous compilation session as green.
689
- #[ instrument( skip( self , tcx , data, prev_dep_node_index) , level = "debug" ) ]
689
+ #[ instrument( skip( self , qcx , data, prev_dep_node_index) , level = "debug" ) ]
690
690
fn try_mark_previous_green < Ctxt : QueryContext < DepKind = K > > (
691
691
& self ,
692
- tcx : Ctxt ,
692
+ qcx : Ctxt ,
693
693
data : & DepGraphData < K > ,
694
694
prev_dep_node_index : SerializedDepNodeIndex ,
695
695
dep_node : & DepNode < K > ,
@@ -701,14 +701,14 @@ impl<K: DepKind> DepGraph<K> {
701
701
}
702
702
703
703
// We never try to mark eval_always nodes as green
704
- debug_assert ! ( !tcx . dep_context( ) . is_eval_always( dep_node. kind) ) ;
704
+ debug_assert ! ( !qcx . dep_context( ) . is_eval_always( dep_node. kind) ) ;
705
705
706
706
debug_assert_eq ! ( data. previous. index_to_node( prev_dep_node_index) , * dep_node) ;
707
707
708
708
let prev_deps = data. previous . edge_targets_from ( prev_dep_node_index) ;
709
709
710
710
for & dep_dep_node_index in prev_deps {
711
- self . try_mark_parent_green ( tcx , data, dep_dep_node_index, dep_node) ?
711
+ self . try_mark_parent_green ( qcx , data, dep_dep_node_index, dep_node) ?
712
712
}
713
713
714
714
// If we got here without hitting a `return` that means that all
@@ -720,7 +720,7 @@ impl<K: DepKind> DepGraph<K> {
720
720
// We allocating an entry for the node in the current dependency graph and
721
721
// adding all the appropriate edges imported from the previous graph
722
722
let dep_node_index = data. current . promote_node_and_deps_to_current (
723
- tcx . dep_context ( ) . profiler ( ) ,
723
+ qcx . dep_context ( ) . profiler ( ) ,
724
724
& data. previous ,
725
725
prev_dep_node_index,
726
726
) ;
@@ -729,7 +729,7 @@ impl<K: DepKind> DepGraph<K> {
729
729
730
730
// FIXME: Store the fact that a node has diagnostics in a bit in the dep graph somewhere
731
731
// Maybe store a list on disk and encode this fact in the DepNodeState
732
- let side_effects = tcx . load_side_effects ( prev_dep_node_index) ;
732
+ let side_effects = qcx . load_side_effects ( prev_dep_node_index) ;
733
733
734
734
#[ cfg( not( parallel_compiler) ) ]
735
735
debug_assert ! (
@@ -740,7 +740,7 @@ impl<K: DepKind> DepGraph<K> {
740
740
) ;
741
741
742
742
if !side_effects. is_empty ( ) {
743
- self . emit_side_effects ( tcx , data, dep_node_index, side_effects) ;
743
+ self . emit_side_effects ( qcx , data, dep_node_index, side_effects) ;
744
744
}
745
745
746
746
// ... and finally storing a "Green" entry in the color map.
@@ -757,7 +757,7 @@ impl<K: DepKind> DepGraph<K> {
757
757
#[ inline( never) ]
758
758
fn emit_side_effects < Ctxt : QueryContext < DepKind = K > > (
759
759
& self ,
760
- tcx : Ctxt ,
760
+ qcx : Ctxt ,
761
761
data : & DepGraphData < K > ,
762
762
dep_node_index : DepNodeIndex ,
763
763
side_effects : QuerySideEffects ,
@@ -769,9 +769,9 @@ impl<K: DepKind> DepGraph<K> {
769
769
// must process side effects
770
770
771
771
// Promote the previous diagnostics to the current session.
772
- tcx . store_side_effects ( dep_node_index, side_effects. clone ( ) ) ;
772
+ qcx . store_side_effects ( dep_node_index, side_effects. clone ( ) ) ;
773
773
774
- let handle = tcx . dep_context ( ) . sess ( ) . diagnostic ( ) ;
774
+ let handle = qcx . dep_context ( ) . sess ( ) . diagnostic ( ) ;
775
775
776
776
for mut diagnostic in side_effects. diagnostics {
777
777
handle. emit_diagnostic ( & mut diagnostic) ;
0 commit comments