Skip to content

Commit 283ec4c

Browse files
committed
Auto merge of #151879 - Zoxc:try-mark-rem-arg, r=<try>
Remove the `dep_node` argument from `try_mark_previous_green`
2 parents a293cc4 + 6765995 commit 283ec4c

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

  • compiler/rustc_query_system/src/dep_graph

compiler/rustc_query_system/src/dep_graph/graph.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,8 @@ impl<D: Deps> DepGraphData<D> {
872872
// Return None if the dep node didn't exist in the previous session
873873
let prev_index = self.previous.node_to_index_opt(dep_node)?;
874874

875+
debug_assert_eq!(self.previous.index_to_node(prev_index), *dep_node);
876+
875877
match self.colors.get(prev_index) {
876878
DepNodeColor::Green(dep_node_index) => Some((prev_index, dep_node_index)),
877879
DepNodeColor::Red => None,
@@ -880,7 +882,7 @@ impl<D: Deps> DepGraphData<D> {
880882
// in the previous compilation session too, so we can try to
881883
// mark it as green by recursively marking all of its
882884
// dependencies green.
883-
self.try_mark_previous_green(qcx, prev_index, dep_node, None)
885+
self.try_mark_previous_green(qcx, prev_index, None)
884886
.map(|dep_node_index| (prev_index, dep_node_index))
885887
}
886888
}
@@ -928,8 +930,7 @@ impl<D: Deps> DepGraphData<D> {
928930
dep_dep_node, dep_dep_node.hash,
929931
);
930932

931-
let node_index =
932-
self.try_mark_previous_green(qcx, parent_dep_node_index, dep_dep_node, Some(frame));
933+
let node_index = self.try_mark_previous_green(qcx, parent_dep_node_index, Some(frame));
933934

934935
if node_index.is_some() {
935936
debug!("managed to MARK dependency {dep_dep_node:?} as green");
@@ -981,15 +982,15 @@ impl<D: Deps> DepGraphData<D> {
981982
&self,
982983
qcx: Qcx,
983984
prev_dep_node_index: SerializedDepNodeIndex,
984-
dep_node: &DepNode,
985985
frame: Option<&MarkFrame<'_>>,
986986
) -> Option<DepNodeIndex> {
987987
let frame = MarkFrame { index: prev_dep_node_index, parent: frame };
988988

989989
// We never try to mark eval_always nodes as green
990-
debug_assert!(!qcx.dep_context().is_eval_always(dep_node.kind));
991-
992-
debug_assert_eq!(self.previous.index_to_node(prev_dep_node_index), *dep_node);
990+
debug_assert!(
991+
!qcx.dep_context()
992+
.is_eval_always(self.previous.index_to_node(prev_dep_node_index).kind)
993+
);
993994

994995
let prev_deps = self.previous.edge_targets_from(prev_dep_node_index);
995996

@@ -1010,7 +1011,10 @@ impl<D: Deps> DepGraphData<D> {
10101011
// ... and finally storing a "Green" entry in the color map.
10111012
// Multiple threads can all write the same color here
10121013

1013-
debug!("successfully marked {dep_node:?} as green");
1014+
debug!(
1015+
"successfully marked {:?} as green",
1016+
self.previous.index_to_node(prev_dep_node_index)
1017+
);
10141018
Some(dep_node_index)
10151019
}
10161020
}

0 commit comments

Comments
 (0)