]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_hir/src/definitions.rs
Rollup merge of #94145 - ssomers:binary_heap_tests, r=jyn514
[rust.git] / compiler / rustc_hir / src / definitions.rs
index d85ac960f9b2f10b415cb0a43d2eaa7de8bfc102..dd37efb6983b429e5db6869e707662775ec444c3 100644 (file)
@@ -368,10 +368,6 @@ pub fn create_def(&mut self, parent: LocalDefId, data: DefPathData) -> LocalDefI
         LocalDefId { local_def_index: self.table.allocate(key, def_path_hash) }
     }
 
-    pub fn iter_local_def_id(&self) -> impl Iterator<Item = LocalDefId> + '_ {
-        self.table.def_path_hashes.indices().map(|local_def_index| LocalDefId { local_def_index })
-    }
-
     #[inline(always)]
     pub fn local_def_path_hash_to_def_id(
         &self,
@@ -389,6 +385,10 @@ pub fn local_def_path_hash_to_def_id(
     pub fn def_path_hash_to_def_index_map(&self) -> &DefPathHashMap {
         &self.table.def_path_hash_to_index
     }
+
+    pub fn num_definitions(&self) -> usize {
+        self.table.def_path_hashes.len()
+    }
 }
 
 #[derive(Copy, Clone, PartialEq, Debug)]