diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-01-09 13:38:32 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-09 13:38:32 +0100 |
| commit | 51001b35bd4079ea40536a264e054eec9b4f11bd (patch) | |
| tree | 14be46fbc02db5e31f03fcd737c154bd637535ec /compiler/rustc_metadata/src | |
| parent | b681dc2af419c5b7f200e44a3604a8dab9ebe3a6 (diff) | |
| parent | 5acd1f91a01eacbe1f7feccf6f1c6775d3c4d1b4 (diff) | |
| download | rust-51001b35bd4079ea40536a264e054eec9b4f11bd.tar.gz rust-51001b35bd4079ea40536a264e054eec9b4f11bd.zip | |
Rollup merge of #92608 - petrochenkov:doctrscope3, r=CraftSpider
rustdoc: Introduce a resolver cache for sharing data between early doc link resolution and later passes The refactoring parts of https://github.com/rust-lang/rust/pull/88679, shouldn't cause any slowdowns. r? `@jyn514`
Diffstat (limited to 'compiler/rustc_metadata/src')
| -rw-r--r-- | compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs index 804f277e26e..f54e68ed4da 100644 --- a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs +++ b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs @@ -10,6 +10,7 @@ use rustc_hir::definitions::{DefKey, DefPath, DefPathHash}; use rustc_middle::hir::exports::Export; use rustc_middle::middle::exported_symbols::ExportedSymbol; use rustc_middle::middle::stability::DeprecationEntry; +use rustc_middle::ty::fast_reject::SimplifiedType; use rustc_middle::ty::query::{ExternProviders, Providers}; use rustc_middle::ty::{self, TyCtxt, Visibility}; use rustc_session::cstore::{CrateSource, CrateStore, ForeignModule}; @@ -187,8 +188,6 @@ provide! { <'tcx> tcx, def_id, other, cdata, extra_filename => { cdata.root.extra_filename.clone() } traits_in_crate => { tcx.arena.alloc_from_iter(cdata.get_traits()) } - all_trait_implementations => { tcx.arena.alloc_from_iter(cdata.get_trait_impls()) } - implementations_of_trait => { cdata.get_implementations_of_trait(tcx, other) } visibility => { cdata.get_visibility(def_id.index) } @@ -468,6 +467,17 @@ impl CStore { ) -> Span { self.get_crate_data(cnum).get_proc_macro_quoted_span(id, sess) } + + pub fn traits_in_crate_untracked(&self, cnum: CrateNum) -> Vec<DefId> { + self.get_crate_data(cnum).get_traits().collect() + } + + pub fn trait_impls_in_crate_untracked( + &self, + cnum: CrateNum, + ) -> Vec<(DefId, Option<SimplifiedType>)> { + self.get_crate_data(cnum).get_trait_impls().collect() + } } impl CrateStore for CStore { |
