diff --git a/compiler/rustc_query_system/src/dep_graph/graph.rs b/compiler/rustc_query_system/src/dep_graph/graph.rs index 5604da46962..0963e8e8bdf 100644 --- a/compiler/rustc_query_system/src/dep_graph/graph.rs +++ b/compiler/rustc_query_system/src/dep_graph/graph.rs @@ -776,7 +776,7 @@ impl DepGraphData { // We failed to mark it green, so we try to force the query. debug!("trying to force dependency {dep_dep_node:?}"); - if !qcx.dep_context().try_force_from_dep_node(*dep_dep_node, data, frame) { + if !qcx.dep_context().try_force_from_dep_node(*dep_dep_node, frame) { // The DepNode could not be forced. debug!("dependency {dep_dep_node:?} could not be forced"); return None; @@ -1416,9 +1416,11 @@ impl DepNodeColorMap { #[inline(never)] #[cold] pub(crate) fn print_markframe_trace( - graph: &DepGraphData, + graph: &DepGraph, frame: Option<&MarkFrame<'_>>, ) { + let data = graph.data.as_ref().unwrap(); + eprintln!("there was a panic while trying to force a dep node"); eprintln!("try_mark_green dep node stack:"); @@ -1426,7 +1428,7 @@ pub(crate) fn print_markframe_trace( let mut current = frame; while let Some(frame) = current { // Do not try to rely on DepNode's Debug implementation, since it may panic. - let node = graph.previous.index_to_node(frame.index); + let node = data.previous.index_to_node(frame.index); eprintln!("#{i} {:?} ({})", node.kind, node.hash); current = frame.parent; i += 1; diff --git a/compiler/rustc_query_system/src/dep_graph/mod.rs b/compiler/rustc_query_system/src/dep_graph/mod.rs index f70a9139743..40e7131987f 100644 --- a/compiler/rustc_query_system/src/dep_graph/mod.rs +++ b/compiler/rustc_query_system/src/dep_graph/mod.rs @@ -20,7 +20,7 @@ use rustc_session::Session; use std::hash::Hash; use std::{fmt, panic}; -use self::graph::{print_markframe_trace, DepGraphData, MarkFrame}; +use self::graph::{print_markframe_trace, MarkFrame}; pub trait DepContext: Copy { type DepKind: self::DepKind; @@ -56,11 +56,10 @@ pub trait DepContext: Copy { /// Try to force a dep node to execute and see if it's green. #[inline] - #[instrument(skip(self, graph, frame), level = "debug")] + #[instrument(skip(self, frame), level = "debug")] fn try_force_from_dep_node( self, dep_node: DepNode, - graph: &DepGraphData, frame: Option<&MarkFrame<'_>>, ) -> bool { let cb = self.dep_kind_info(dep_node.kind); @@ -69,7 +68,7 @@ pub trait DepContext: Copy { f(self, dep_node); })) { if !value.is::() { - print_markframe_trace(graph, frame); + print_markframe_trace(self.dep_graph(), frame); } panic::resume_unwind(value) }