@@ -26,8 +26,8 @@ use crate::query::{QueryContext, QuerySideEffects};
2626use { super :: debug:: EdgeFilter , std:: env} ;
2727
2828#[ derive( Clone ) ]
29- pub struct DepGraph < D : Deps > {
30- data : Option < Lrc < DepGraphData < D > > > ,
29+ pub struct DepGraph {
30+ data : Option < Lrc < DepGraphData > > ,
3131
3232 /// This field is used for assigning DepNodeIndices when running in
3333 /// non-incremental mode. Even in non-incremental mode we make sure that
@@ -73,12 +73,12 @@ impl DepNodeColor {
7373 }
7474}
7575
76- pub ( crate ) struct DepGraphData < D : Deps > {
76+ pub ( crate ) struct DepGraphData {
7777 /// The new encoding of the dependency graph, optimized for red/green
7878 /// tracking. The `current` field is the dependency graph of only the
7979 /// current compilation session: We don't merge the previous dep-graph into
8080 /// current one anymore, but we do reference shared data to save space.
81- current : CurrentDepGraph < D > ,
81+ current : CurrentDepGraph ,
8282
8383 /// The dep-graph from the previous compilation session. It contains all
8484 /// nodes and edges as well as all fingerprints of nodes that have them.
@@ -111,18 +111,18 @@ where
111111 stable_hasher. finish ( )
112112}
113113
114- impl < D : Deps > DepGraph < D > {
115- pub fn new (
114+ impl DepGraph {
115+ pub fn new < D : Deps > (
116116 profiler : & SelfProfilerRef ,
117117 prev_graph : SerializedDepGraph ,
118118 prev_work_products : WorkProductMap ,
119119 encoder : FileEncoder ,
120120 record_graph : bool ,
121121 record_stats : bool ,
122- ) -> DepGraph < D > {
122+ ) -> DepGraph {
123123 let prev_graph_node_count = prev_graph. node_count ( ) ;
124124
125- let current = CurrentDepGraph :: new (
125+ let current = CurrentDepGraph :: new :: < D > (
126126 profiler,
127127 prev_graph_node_count,
128128 encoder,
@@ -179,12 +179,12 @@ impl<D: Deps> DepGraph<D> {
179179 }
180180 }
181181
182- pub fn new_disabled ( ) -> DepGraph < D > {
182+ pub fn new_disabled ( ) -> DepGraph {
183183 DepGraph { data : None , virtual_dep_node_index : Lrc :: new ( AtomicU32 :: new ( 0 ) ) }
184184 }
185185
186186 #[ inline]
187- pub ( crate ) fn data ( & self ) -> Option < & DepGraphData < D > > {
187+ pub ( crate ) fn data ( & self ) -> Option < & DepGraphData > {
188188 self . data . as_deref ( )
189189 }
190190
@@ -273,7 +273,7 @@ impl<D: Deps> DepGraph<D> {
273273 }
274274
275275 #[ inline( always) ]
276- pub fn with_task < Ctxt : HasDepContext < Deps = D > , A : Debug , R > (
276+ pub fn with_task < Ctxt : HasDepContext , A : Debug , R > (
277277 & self ,
278278 key : DepNode ,
279279 cx : Ctxt ,
@@ -287,7 +287,7 @@ impl<D: Deps> DepGraph<D> {
287287 }
288288 }
289289
290- pub fn with_anon_task < Tcx : DepContext < Deps = D > , OP , R > (
290+ pub fn with_anon_task < Tcx : DepContext , OP , R > (
291291 & self ,
292292 cx : Tcx ,
293293 dep_kind : DepKind ,
@@ -303,7 +303,7 @@ impl<D: Deps> DepGraph<D> {
303303 }
304304}
305305
306- impl < D : Deps > DepGraphData < D > {
306+ impl DepGraphData {
307307 /// Starts a new dep-graph task. Dep-graph tasks are specified
308308 /// using a free function (`task`) and **not** a closure -- this
309309 /// is intentional because we want to exercise tight control over
@@ -332,7 +332,7 @@ impl<D: Deps> DepGraphData<D> {
332332 ///
333333 /// [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/queries/incremental-compilation.html
334334 #[ inline( always) ]
335- pub ( crate ) fn with_task < Ctxt : HasDepContext < Deps = D > , A : Debug , R > (
335+ pub ( crate ) fn with_task < Ctxt : HasDepContext , A : Debug , R > (
336336 & self ,
337337 key : DepNode ,
338338 cx : Ctxt ,
@@ -397,7 +397,7 @@ impl<D: Deps> DepGraphData<D> {
397397
398398 /// Executes something within an "anonymous" task, that is, a task the
399399 /// `DepNode` of which is determined by the list of inputs it read from.
400- pub ( crate ) fn with_anon_task < Tcx : DepContext < Deps = D > , OP , R > (
400+ pub ( crate ) fn with_anon_task < Tcx : DepContext , OP , R > (
401401 & self ,
402402 cx : Tcx ,
403403 dep_kind : DepKind ,
@@ -456,7 +456,7 @@ impl<D: Deps> DepGraphData<D> {
456456 }
457457}
458458
459- impl < D : Deps > DepGraph < D > {
459+ impl DepGraph {
460460 #[ inline]
461461 pub fn read_index ( & self , dep_node_index : DepNodeIndex ) {
462462 if let Some ( ref data) = self . data {
@@ -527,7 +527,7 @@ impl<D: Deps> DepGraph<D> {
527527 /// FIXME: If the code is changed enough for this node to be marked before requiring the
528528 /// caller's node, we suppose that those changes will be enough to mark this node red and
529529 /// force a recomputation using the "normal" way.
530- pub fn with_feed_task < Ctxt : DepContext < Deps = D > , A : Debug , R : Debug > (
530+ pub fn with_feed_task < Ctxt : DepContext , A : Debug , R : Debug > (
531531 & self ,
532532 node : DepNode ,
533533 cx : Ctxt ,
@@ -615,7 +615,7 @@ impl<D: Deps> DepGraph<D> {
615615 }
616616}
617617
618- impl < D : Deps > DepGraphData < D > {
618+ impl DepGraphData {
619619 #[ inline]
620620 fn dep_node_index_of_opt ( & self , dep_node : & DepNode ) -> Option < DepNodeIndex > {
621621 if let Some ( prev_index) = self . previous . node_to_index_opt ( dep_node) {
@@ -661,7 +661,7 @@ impl<D: Deps> DepGraphData<D> {
661661 }
662662}
663663
664- impl < D : Deps > DepGraph < D > {
664+ impl DepGraph {
665665 #[ inline]
666666 pub fn dep_node_exists ( & self , dep_node : & DepNode ) -> bool {
667667 self . data . as_ref ( ) . is_some_and ( |data| data. dep_node_exists ( dep_node) )
@@ -710,7 +710,7 @@ impl<D: Deps> DepGraph<D> {
710710 None
711711 }
712712
713- pub fn try_mark_green < Qcx : QueryContext < Deps = D > > (
713+ pub fn try_mark_green < Qcx : QueryContext > (
714714 & self ,
715715 qcx : Qcx ,
716716 dep_node : & DepNode ,
@@ -719,13 +719,13 @@ impl<D: Deps> DepGraph<D> {
719719 }
720720}
721721
722- impl < D : Deps > DepGraphData < D > {
722+ impl DepGraphData {
723723 /// Try to mark a node index for the node dep_node.
724724 ///
725725 /// A node will have an index, when it's already been marked green, or when we can mark it
726726 /// green. This function will mark the current task as a reader of the specified node, when
727727 /// a node index can be found for that node.
728- pub ( crate ) fn try_mark_green < Qcx : QueryContext < Deps = D > > (
728+ pub ( crate ) fn try_mark_green < Qcx : QueryContext > (
729729 & self ,
730730 qcx : Qcx ,
731731 dep_node : & DepNode ,
@@ -750,7 +750,7 @@ impl<D: Deps> DepGraphData<D> {
750750 }
751751
752752 #[ instrument( skip( self , qcx, parent_dep_node_index, frame) , level = "debug" ) ]
753- fn try_mark_parent_green < Qcx : QueryContext < Deps = D > > (
753+ fn try_mark_parent_green < Qcx : QueryContext > (
754754 & self ,
755755 qcx : Qcx ,
756756 parent_dep_node_index : SerializedDepNodeIndex ,
@@ -838,7 +838,7 @@ impl<D: Deps> DepGraphData<D> {
838838
839839 /// Try to mark a dep-node which existed in the previous compilation session as green.
840840 #[ instrument( skip( self , qcx, prev_dep_node_index, frame) , level = "debug" ) ]
841- fn try_mark_previous_green < Qcx : QueryContext < Deps = D > > (
841+ fn try_mark_previous_green < Qcx : QueryContext > (
842842 & self ,
843843 qcx : Qcx ,
844844 prev_dep_node_index : SerializedDepNodeIndex ,
@@ -909,7 +909,7 @@ impl<D: Deps> DepGraphData<D> {
909909 /// This may be called concurrently on multiple threads for the same dep node.
910910 #[ cold]
911911 #[ inline( never) ]
912- fn emit_side_effects < Qcx : QueryContext < Deps = D > > (
912+ fn emit_side_effects < Qcx : QueryContext > (
913913 & self ,
914914 qcx : Qcx ,
915915 dep_node_index : DepNodeIndex ,
@@ -933,7 +933,7 @@ impl<D: Deps> DepGraphData<D> {
933933 }
934934}
935935
936- impl < D : Deps > DepGraph < D > {
936+ impl DepGraph {
937937 /// Returns true if the given node has been marked as red during the
938938 /// current compilation session. Used in various assertions
939939 pub fn is_red ( & self , dep_node : & DepNode ) -> bool {
@@ -1069,8 +1069,8 @@ rustc_index::newtype_index! {
10691069/// `new_node_to_index` and `data`, or `prev_index_to_index` and `data`. When
10701070/// manipulating both, we acquire `new_node_to_index` or `prev_index_to_index`
10711071/// first, and `data` second.
1072- pub ( super ) struct CurrentDepGraph < D : Deps > {
1073- encoder : Steal < GraphEncoder < D > > ,
1072+ pub ( super ) struct CurrentDepGraph {
1073+ encoder : Steal < GraphEncoder > ,
10741074 new_node_to_index : Sharded < FxHashMap < DepNode , DepNodeIndex > > ,
10751075 prev_index_to_index : Lock < IndexVec < SerializedDepNodeIndex , Option < DepNodeIndex > > > ,
10761076
@@ -1109,8 +1109,8 @@ pub(super) struct CurrentDepGraph<D: Deps> {
11091109 node_intern_event_id : Option < EventId > ,
11101110}
11111111
1112- impl < D : Deps > CurrentDepGraph < D > {
1113- fn new (
1112+ impl CurrentDepGraph {
1113+ fn new < D : Deps > (
11141114 profiler : & SelfProfilerRef ,
11151115 prev_graph_node_count : usize ,
11161116 encoder : FileEncoder ,
@@ -1146,7 +1146,7 @@ impl<D: Deps> CurrentDepGraph<D> {
11461146 . map ( EventId :: from_label) ;
11471147
11481148 CurrentDepGraph {
1149- encoder : Steal :: new ( GraphEncoder :: new (
1149+ encoder : Steal :: new ( GraphEncoder :: new :: < D > (
11501150 encoder,
11511151 prev_graph_node_count,
11521152 record_graph,
@@ -1392,7 +1392,7 @@ impl DepNodeColorMap {
13921392
13931393#[ inline( never) ]
13941394#[ cold]
1395- pub ( crate ) fn print_markframe_trace < D : Deps > ( graph : & DepGraph < D > , frame : Option < & MarkFrame < ' _ > > ) {
1395+ pub ( crate ) fn print_markframe_trace ( graph : & DepGraph , frame : Option < & MarkFrame < ' _ > > ) {
13961396 let data = graph. data . as_ref ( ) . unwrap ( ) ;
13971397
13981398 eprintln ! ( "there was a panic while trying to force a dep node" ) ;
0 commit comments