diff options
| author | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2023-03-09 07:38:09 +0100 |
|---|---|---|
| committer | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2023-03-09 08:00:54 +0100 |
| commit | 42a0aaa9343bb8f75d1cfe3db65a07102bad9e4f (patch) | |
| tree | 3b4e9653f93912b8d7fe87b4c30f7de7646f4a16 | |
| parent | 62e4bcb168b354b5780e2a0abc02b61e6a4efee3 (diff) | |
| download | rust-42a0aaa9343bb8f75d1cfe3db65a07102bad9e4f.tar.gz rust-42a0aaa9343bb8f75d1cfe3db65a07102bad9e4f.zip | |
Remove `dep_node_index_of_opt` and `dep_node_index_of`
| -rw-r--r-- | compiler/rustc_query_system/src/dep_graph/graph.rs | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/compiler/rustc_query_system/src/dep_graph/graph.rs b/compiler/rustc_query_system/src/dep_graph/graph.rs index 0fe1ddc1235..8a9a1238606 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<K: DepKind> DepGraph<K> { // 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<K: DepKind> DepGraph<K> { self.next_virtual_depnode_index() } } - - #[inline] - pub fn dep_node_index_of(&self, dep_node: &DepNode<K>) -> DepNodeIndex { - self.dep_node_index_of_opt(dep_node).unwrap() - } - - #[inline] - pub fn dep_node_index_of_opt(&self, dep_node: &DepNode<K>) -> Option<DepNodeIndex> { - self.data.as_ref().unwrap().dep_node_index_of_opt(dep_node) - } } impl<K: DepKind> DepGraphData<K> { @@ -649,7 +639,7 @@ impl<K: DepKind> DepGraphData<K> { impl<K: DepKind> DepGraph<K> { #[inline] pub fn dep_node_exists(&self, dep_node: &DepNode<K>) -> 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 |
