Skip to content

Commit 867de8b

Browse files
committed
Remove graph parameter from try_force_from_dep_node
1 parent 8dd0f20 commit 867de8b

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

compiler/rustc_query_system/src/dep_graph/graph.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ impl<K: DepKind> DepGraphData<K> {
776776

777777
// We failed to mark it green, so we try to force the query.
778778
debug!("trying to force dependency {dep_dep_node:?}");
779-
if !qcx.dep_context().try_force_from_dep_node(*dep_dep_node, data, frame) {
779+
if !qcx.dep_context().try_force_from_dep_node(*dep_dep_node, frame) {
780780
// The DepNode could not be forced.
781781
debug!("dependency {dep_dep_node:?} could not be forced");
782782
return None;
@@ -1416,17 +1416,19 @@ impl DepNodeColorMap {
14161416
#[inline(never)]
14171417
#[cold]
14181418
pub(crate) fn print_markframe_trace<K: DepKind>(
1419-
graph: &DepGraphData<K>,
1419+
graph: &DepGraph<K>,
14201420
frame: Option<&MarkFrame<'_>>,
14211421
) {
1422+
let data = graph.data.as_ref().unwrap();
1423+
14221424
eprintln!("there was a panic while trying to force a dep node");
14231425
eprintln!("try_mark_green dep node stack:");
14241426

14251427
let mut i = 0;
14261428
let mut current = frame;
14271429
while let Some(frame) = current {
14281430
// Do not try to rely on DepNode's Debug implementation, since it may panic.
1429-
let node = graph.previous.index_to_node(frame.index);
1431+
let node = data.previous.index_to_node(frame.index);
14301432
eprintln!("#{i} {:?} ({})", node.kind, node.hash);
14311433
current = frame.parent;
14321434
i += 1;

compiler/rustc_query_system/src/dep_graph/mod.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use rustc_session::Session;
2020
use std::hash::Hash;
2121
use std::{fmt, panic};
2222

23-
use self::graph::{print_markframe_trace, DepGraphData, MarkFrame};
23+
use self::graph::{print_markframe_trace, MarkFrame};
2424

2525
pub trait DepContext: Copy {
2626
type DepKind: self::DepKind;
@@ -56,11 +56,10 @@ pub trait DepContext: Copy {
5656

5757
/// Try to force a dep node to execute and see if it's green.
5858
#[inline]
59-
#[instrument(skip(self, graph, frame), level = "debug")]
59+
#[instrument(skip(self, frame), level = "debug")]
6060
fn try_force_from_dep_node(
6161
self,
6262
dep_node: DepNode<Self::DepKind>,
63-
graph: &DepGraphData<Self::DepKind>,
6463
frame: Option<&MarkFrame<'_>>,
6564
) -> bool {
6665
let cb = self.dep_kind_info(dep_node.kind);
@@ -69,7 +68,7 @@ pub trait DepContext: Copy {
6968
f(self, dep_node);
7069
})) {
7170
if !value.is::<rustc_errors::FatalErrorMarker>() {
72-
print_markframe_trace(graph, frame);
71+
print_markframe_trace(self.dep_graph(), frame);
7372
}
7473
panic::resume_unwind(value)
7574
}

0 commit comments

Comments
 (0)