about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-05-04 20:56:49 +0000
committerbors <bors@rust-lang.org>2021-05-04 20:56:49 +0000
commitae8b84bf04cddda2379b36c45a575132e6a44fb0 (patch)
tree62e54bca4d742c7fcf52dc610ae20b96d9df280e /compiler
parent8bf0bd9c7957776945f5c2404eba1edd6ae3127d (diff)
parentb6120bfb354c1c1c9fdfe7ff03daa5550a8706fc (diff)
downloadrust-ae8b84bf04cddda2379b36c45a575132e6a44fb0.tar.gz
rust-ae8b84bf04cddda2379b36c45a575132e6a44fb0.zip
Auto merge of #84707 - Stupremee:remove-fake-defids-in-rustdoc, r=jyn514,GuillaumeGomez
Get rid of fake `DefId`s in rustdoc

Right now there are *many* errors left, but I wanted to show the current state since all that is left to do is fixing the errors.

Resolves #83183

r? `@jyn514`
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_hir/src/definitions.rs5
-rw-r--r--compiler/rustc_metadata/src/rmeta/decoder.rs4
-rw-r--r--compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs4
3 files changed, 0 insertions, 13 deletions
diff --git a/compiler/rustc_hir/src/definitions.rs b/compiler/rustc_hir/src/definitions.rs
index 0f77de9fb25..647d735fb86 100644
--- a/compiler/rustc_hir/src/definitions.rs
+++ b/compiler/rustc_hir/src/definitions.rs
@@ -87,11 +87,6 @@ impl DefPathTable {
         hash
     }
 
-    /// Used by librustdoc for fake DefIds.
-    pub fn num_def_ids(&self) -> usize {
-        self.index_to_key.len()
-    }
-
     pub fn enumerated_keys_and_path_hashes(
         &self,
     ) -> impl Iterator<Item = (DefIndex, &DefKey, &DefPathHash)> + '_ {
diff --git a/compiler/rustc_metadata/src/rmeta/decoder.rs b/compiler/rustc_metadata/src/rmeta/decoder.rs
index 2ade1bb4f95..d74fef0045f 100644
--- a/compiler/rustc_metadata/src/rmeta/decoder.rs
+++ b/compiler/rustc_metadata/src/rmeta/decoder.rs
@@ -1885,10 +1885,6 @@ impl CrateMetadata {
         self.root.hash
     }
 
-    fn num_def_ids(&self) -> usize {
-        self.root.tables.def_keys.size()
-    }
-
     fn local_def_id(&self, index: DefIndex) -> DefId {
         DefId { krate: self.cnum, index }
     }
diff --git a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs
index bebee9dac3b..8595a70dd94 100644
--- a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs
+++ b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs
@@ -461,10 +461,6 @@ impl CStore {
         self.get_crate_data(def_id.krate).module_expansion(def_id.index, sess)
     }
 
-    pub fn num_def_ids(&self, cnum: CrateNum) -> usize {
-        self.get_crate_data(cnum).num_def_ids()
-    }
-
     pub fn item_attrs(&self, def_id: DefId, sess: &Session) -> Vec<ast::Attribute> {
         self.get_crate_data(def_id.krate).get_item_attrs(def_id.index, sess).collect()
     }