diff --git a/compiler/rustc_query_system/src/dep_graph/graph.rs b/compiler/rustc_query_system/src/dep_graph/graph.rs index 0fe1ddc12350..8a9a12386064 100644 --- a/compiler/rustc_query_system/src/dep_graph/graph.rs +++ b/compiler/rustc_query_system/src/dep_graph/graph.rs @@ -531,7 +531,7 @@ impl DepGraph { // value to an existing node. // // For sanity, we still check that the loaded stable hash and the new one match. - if let Some(dep_node_index) = self.dep_node_index_of_opt(&node) { + if let Some(dep_node_index) = data.dep_node_index_of_opt(&node) { let _current_fingerprint = crate::query::incremental_verify_ich(cx, data, result, &node, hash_result); @@ -589,16 +589,6 @@ impl DepGraph { self.next_virtual_depnode_index() } } - - #[inline] - pub fn dep_node_index_of(&self, dep_node: &DepNode) -> DepNodeIndex { - self.dep_node_index_of_opt(dep_node).unwrap() - } - - #[inline] - pub fn dep_node_index_of_opt(&self, dep_node: &DepNode) -> Option { - self.data.as_ref().unwrap().dep_node_index_of_opt(dep_node) - } } impl DepGraphData { @@ -649,7 +639,7 @@ impl DepGraphData { impl DepGraph { #[inline] pub fn dep_node_exists(&self, dep_node: &DepNode) -> bool { - self.data.is_some() && self.dep_node_index_of_opt(dep_node).is_some() + self.data.as_ref().and_then(|data| data.dep_node_index_of_opt(dep_node)).is_some() } /// Checks whether a previous work product exists for `v` and, if