Skip to content

Commit 42a0aaa

Browse files
committed
Remove dep_node_index_of_opt and dep_node_index_of
1 parent 62e4bcb commit 42a0aaa

File tree

1 file changed

+2
-12
lines changed
  • compiler/rustc_query_system/src/dep_graph

1 file changed

+2
-12
lines changed

compiler/rustc_query_system/src/dep_graph/graph.rs

+2-12
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ impl<K: DepKind> DepGraph<K> {
531531
// value to an existing node.
532532
//
533533
// For sanity, we still check that the loaded stable hash and the new one match.
534-
if let Some(dep_node_index) = self.dep_node_index_of_opt(&node) {
534+
if let Some(dep_node_index) = data.dep_node_index_of_opt(&node) {
535535
let _current_fingerprint =
536536
crate::query::incremental_verify_ich(cx, data, result, &node, hash_result);
537537

@@ -589,16 +589,6 @@ impl<K: DepKind> DepGraph<K> {
589589
self.next_virtual_depnode_index()
590590
}
591591
}
592-
593-
#[inline]
594-
pub fn dep_node_index_of(&self, dep_node: &DepNode<K>) -> DepNodeIndex {
595-
self.dep_node_index_of_opt(dep_node).unwrap()
596-
}
597-
598-
#[inline]
599-
pub fn dep_node_index_of_opt(&self, dep_node: &DepNode<K>) -> Option<DepNodeIndex> {
600-
self.data.as_ref().unwrap().dep_node_index_of_opt(dep_node)
601-
}
602592
}
603593

604594
impl<K: DepKind> DepGraphData<K> {
@@ -649,7 +639,7 @@ impl<K: DepKind> DepGraphData<K> {
649639
impl<K: DepKind> DepGraph<K> {
650640
#[inline]
651641
pub fn dep_node_exists(&self, dep_node: &DepNode<K>) -> bool {
652-
self.data.is_some() && self.dep_node_index_of_opt(dep_node).is_some()
642+
self.data.as_ref().and_then(|data| data.dep_node_index_of_opt(dep_node)).is_some()
653643
}
654644

655645
/// Checks whether a previous work product exists for `v` and, if

0 commit comments

Comments
 (0)