mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-25 12:33:33 +00:00
Merge #3724
3724: Cleanup memory usage stats r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
402bf53a09
4 changed files with 16 additions and 11 deletions
|
@ -10,15 +10,16 @@ pub use hir_def::db::{
|
|||
TraitDataQuery, TypeAliasDataQuery, UnionDataQuery,
|
||||
};
|
||||
pub use hir_expand::db::{
|
||||
AstDatabase, AstDatabaseStorage, AstIdMapQuery, InternMacroQuery, MacroArgQuery, MacroDefQuery,
|
||||
MacroExpandQuery, ParseMacroQuery,
|
||||
AstDatabase, AstDatabaseStorage, AstIdMapQuery, InternEagerExpansionQuery, InternMacroQuery,
|
||||
MacroArgQuery, MacroDefQuery, MacroExpandQuery, ParseMacroQuery,
|
||||
};
|
||||
pub use hir_ty::db::{
|
||||
AssociatedTyDataQuery, AssociatedTyValueQuery, CallableItemSignatureQuery, FieldTypesQuery,
|
||||
GenericDefaultsQuery, GenericPredicatesForParamQuery, GenericPredicatesQuery, HirDatabase,
|
||||
HirDatabaseStorage, ImplDatumQuery, ImplSelfTyQuery, ImplTraitQuery, ImplsForTraitQuery,
|
||||
ImplsInCrateQuery, InferQueryQuery, InternAssocTyValueQuery, InternChalkImplQuery,
|
||||
InternTypeCtorQuery, StructDatumQuery, TraitDatumQuery, TraitSolveQuery, TyQuery, ValueTyQuery,
|
||||
InternTypeCtorQuery, InternTypeParamIdQuery, StructDatumQuery, TraitDatumQuery,
|
||||
TraitSolveQuery, TyQuery, ValueTyQuery,
|
||||
};
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -48,6 +48,7 @@ pub trait DefDatabase: InternDatabase + AstDatabase + Upcast<dyn AstDatabase> {
|
|||
fn raw_items(&self, file_id: HirFileId) -> Arc<RawItems>;
|
||||
|
||||
#[salsa::invoke(crate_def_map_wait)]
|
||||
#[salsa::transparent]
|
||||
fn crate_def_map(&self, krate: CrateId) -> Arc<CrateDefMap>;
|
||||
|
||||
#[salsa::invoke(CrateDefMap::crate_def_map_query)]
|
||||
|
@ -109,12 +110,6 @@ pub trait DefDatabase: InternDatabase + AstDatabase + Upcast<dyn AstDatabase> {
|
|||
fn documentation(&self, def: AttrDefId) -> Option<Documentation>;
|
||||
}
|
||||
|
||||
// impl<T: DefDatabase> Upcast<dyn AstDatabase> for T {
|
||||
// fn upcast(&self) -> &dyn AstDatabase {
|
||||
// &*self
|
||||
// }
|
||||
// }
|
||||
|
||||
fn crate_def_map_wait(db: &impl DefDatabase, krate: CrateId) -> Arc<CrateDefMap> {
|
||||
let _p = profile("crate_def_map:wait");
|
||||
db.crate_def_map_query(krate)
|
||||
|
|
|
@ -22,6 +22,7 @@ use hir_expand::name::Name;
|
|||
#[salsa::requires(salsa::Database)]
|
||||
pub trait HirDatabase: DefDatabase + Upcast<dyn DefDatabase> {
|
||||
#[salsa::invoke(infer_wait)]
|
||||
#[salsa::transparent]
|
||||
fn infer(&self, def: DefWithBodyId) -> Arc<InferenceResult>;
|
||||
|
||||
#[salsa::invoke(crate::infer::infer_query)]
|
||||
|
|
|
@ -311,6 +311,7 @@ impl RootDatabase {
|
|||
hir::db::MacroDefQuery
|
||||
hir::db::ParseMacroQuery
|
||||
hir::db::MacroExpandQuery
|
||||
hir::db::InternEagerExpansionQuery
|
||||
|
||||
// DefDatabase
|
||||
hir::db::RawItemsQuery
|
||||
|
@ -359,14 +360,21 @@ impl RootDatabase {
|
|||
hir::db::ImplsInCrateQuery
|
||||
hir::db::ImplsForTraitQuery
|
||||
hir::db::InternTypeCtorQuery
|
||||
hir::db::InternTypeParamIdQuery
|
||||
hir::db::InternChalkImplQuery
|
||||
hir::db::InternAssocTyValueQuery
|
||||
hir::db::AssociatedTyDataQuery
|
||||
hir::db::AssociatedTyValueQuery
|
||||
hir::db::TraitSolveQuery
|
||||
hir::db::TraitDatumQuery
|
||||
hir::db::StructDatumQuery
|
||||
hir::db::ImplDatumQuery
|
||||
hir::db::AssociatedTyValueQuery
|
||||
hir::db::TraitSolveQuery
|
||||
|
||||
// SymbolsDatabase
|
||||
crate::symbol_index::FileSymbolsQuery
|
||||
|
||||
// LineIndexDatabase
|
||||
crate::LineIndexQuery
|
||||
];
|
||||
acc.sort_by_key(|it| std::cmp::Reverse(it.1));
|
||||
acc
|
||||
|
|
Loading…
Reference in a new issue