diff options
| author | Denis Merigoux <denis.merigoux@gmail.com> | 2021-06-01 14:10:14 +0200 |
|---|---|---|
| committer | Denis Merigoux <denis.merigoux@gmail.com> | 2021-06-03 09:27:41 +0200 |
| commit | d4ea9fa3fb400e1c5748489a65859fdead3dd132 (patch) | |
| tree | a4ec8014ae889f4e922e201aad15386a7fd0647b /compiler/rustc_metadata/src/rmeta/decoder | |
| parent | c4f186f0ea443db4aacdd90a2515632c20ccd3fe (diff) | |
Restore the num_def_ids_untracked public function giving the total number of exported symbols for each crate
Restored underlying num_def_ids_method Update compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs Changed name to fit with naming convention Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com> Update compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs Replace regular doc with Rustdoc comment Co-authored-by: Joshua Nelson <jyn514@gmail.com> Clarifies third-party use of num_def_ids_untracked
Diffstat (limited to 'compiler/rustc_metadata/src/rmeta/decoder')
| -rw-r--r-- | compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs index 02d1cf9aec7..c1e12bb7a49 100644 --- a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs +++ b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs @@ -454,6 +454,13 @@ impl CStore { self.get_crate_data(def_id.krate).module_expansion(def_id.index, sess) } + /// Only public-facing way to traverse all the definitions in a non-local crate. + /// Critically useful for this third-party project: <https://github.com/hacspec/hacspec>. + /// See <https://github.com/rust-lang/rust/pull/85889> for context. + pub fn num_def_ids_untracked(&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() } |
