aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/db.rs
diff options
context:
space:
mode:
authorSeivan Heidari <[email protected]>2019-11-18 01:27:53 +0000
committerSeivan Heidari <[email protected]>2019-11-18 01:27:53 +0000
commit166636ba77adcf5bf2c4ef935e9aa75e20f25e10 (patch)
tree168be1ca55c73b016e20586c08417c608450c92c /crates/ra_hir/src/db.rs
parentcb26df950699586b314731fb70786e0db8eaa049 (diff)
parent28c2d74b2150102a8756a5357a5a965d7610bd15 (diff)
Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into feature/themes
Diffstat (limited to 'crates/ra_hir/src/db.rs')
-rw-r--r--crates/ra_hir/src/db.rs50
1 files changed, 29 insertions, 21 deletions
diff --git a/crates/ra_hir/src/db.rs b/crates/ra_hir/src/db.rs
index c60029c01..d75d71d66 100644
--- a/crates/ra_hir/src/db.rs
+++ b/crates/ra_hir/src/db.rs
@@ -10,22 +10,23 @@ use crate::{
10 debug::HirDebugDatabase, 10 debug::HirDebugDatabase,
11 generics::{GenericDef, GenericParams}, 11 generics::{GenericDef, GenericParams},
12 ids, 12 ids,
13 impl_block::{ImplBlock, ImplSourceMap, ModuleImplBlocks},
14 lang_item::{LangItemTarget, LangItems}, 13 lang_item::{LangItemTarget, LangItems},
15 traits::TraitData, 14 traits::TraitData,
16 ty::{ 15 ty::{
17 method_resolution::CrateImplBlocks, traits::Impl, CallableDef, FnSig, GenericPredicate, 16 method_resolution::CrateImplBlocks,
18 InferenceResult, Namespace, Substs, Ty, TypableDef, TypeCtor, 17 traits::{AssocTyValue, Impl},
18 CallableDef, FnSig, GenericPredicate, InferenceResult, Namespace, Substs, Ty, TypableDef,
19 TypeCtor,
19 }, 20 },
20 type_alias::TypeAliasData, 21 type_alias::TypeAliasData,
21 Const, ConstData, Crate, DefWithBody, FnData, Function, Module, Static, StructField, Trait, 22 Const, ConstData, Crate, DefWithBody, FnData, Function, ImplBlock, Module, Static, StructField,
22 TypeAlias, 23 Trait, TypeAlias,
23}; 24};
24 25
25pub use hir_def::db::{ 26pub use hir_def::db::{
26 BodyQuery, BodyWithSourceMapQuery, CrateDefMapQuery, DefDatabase2, DefDatabase2Storage, 27 BodyQuery, BodyWithSourceMapQuery, CrateDefMapQuery, DefDatabase2, DefDatabase2Storage,
27 EnumDataQuery, ExprScopesQuery, InternDatabase, InternDatabaseStorage, RawItemsQuery, 28 EnumDataQuery, ExprScopesQuery, ImplDataQuery, InternDatabase, InternDatabaseStorage,
28 RawItemsWithSourceMapQuery, StructDataQuery, 29 RawItemsQuery, RawItemsWithSourceMapQuery, StructDataQuery,
29}; 30};
30pub use hir_expand::db::{ 31pub use hir_expand::db::{
31 AstDatabase, AstDatabaseStorage, AstIdMapQuery, MacroArgQuery, MacroDefQuery, MacroExpandQuery, 32 AstDatabase, AstDatabaseStorage, AstIdMapQuery, MacroArgQuery, MacroDefQuery, MacroExpandQuery,
@@ -42,15 +43,6 @@ pub trait DefDatabase: HirDebugDatabase + DefDatabase2 {
42 #[salsa::invoke(crate::traits::TraitItemsIndex::trait_items_index)] 43 #[salsa::invoke(crate::traits::TraitItemsIndex::trait_items_index)]
43 fn trait_items_index(&self, module: Module) -> crate::traits::TraitItemsIndex; 44 fn trait_items_index(&self, module: Module) -> crate::traits::TraitItemsIndex;
44 45
45 #[salsa::invoke(ModuleImplBlocks::impls_in_module_with_source_map_query)]
46 fn impls_in_module_with_source_map(
47 &self,
48 module: Module,
49 ) -> (Arc<ModuleImplBlocks>, Arc<ImplSourceMap>);
50
51 #[salsa::invoke(ModuleImplBlocks::impls_in_module_query)]
52 fn impls_in_module(&self, module: Module) -> Arc<ModuleImplBlocks>;
53
54 #[salsa::invoke(crate::generics::GenericParams::generic_params_query)] 46 #[salsa::invoke(crate::generics::GenericParams::generic_params_query)]
55 fn generic_params(&self, def: GenericDef) -> Arc<GenericParams>; 47 fn generic_params(&self, def: GenericDef) -> Arc<GenericParams>;
56 48
@@ -128,27 +120,43 @@ pub trait HirDatabase: DefDatabase + AstDatabase {
128 #[salsa::interned] 120 #[salsa::interned]
129 fn intern_type_ctor(&self, type_ctor: TypeCtor) -> ids::TypeCtorId; 121 fn intern_type_ctor(&self, type_ctor: TypeCtor) -> ids::TypeCtorId;
130 #[salsa::interned] 122 #[salsa::interned]
131 fn intern_impl(&self, impl_: Impl) -> ids::GlobalImplId; 123 fn intern_chalk_impl(&self, impl_: Impl) -> ids::GlobalImplId;
124 #[salsa::interned]
125 fn intern_assoc_ty_value(&self, assoc_ty_value: AssocTyValue) -> ids::AssocTyValueId;
132 126
133 #[salsa::invoke(crate::ty::traits::chalk::associated_ty_data_query)] 127 #[salsa::invoke(crate::ty::traits::chalk::associated_ty_data_query)]
134 fn associated_ty_data(&self, id: chalk_ir::TypeId) -> Arc<chalk_rust_ir::AssociatedTyDatum>; 128 fn associated_ty_data(
129 &self,
130 id: chalk_ir::TypeId,
131 ) -> Arc<chalk_rust_ir::AssociatedTyDatum<chalk_ir::family::ChalkIr>>;
135 132
136 #[salsa::invoke(crate::ty::traits::chalk::trait_datum_query)] 133 #[salsa::invoke(crate::ty::traits::chalk::trait_datum_query)]
137 fn trait_datum( 134 fn trait_datum(
138 &self, 135 &self,
139 krate: Crate, 136 krate: Crate,
140 trait_id: chalk_ir::TraitId, 137 trait_id: chalk_ir::TraitId,
141 ) -> Arc<chalk_rust_ir::TraitDatum>; 138 ) -> Arc<chalk_rust_ir::TraitDatum<chalk_ir::family::ChalkIr>>;
142 139
143 #[salsa::invoke(crate::ty::traits::chalk::struct_datum_query)] 140 #[salsa::invoke(crate::ty::traits::chalk::struct_datum_query)]
144 fn struct_datum( 141 fn struct_datum(
145 &self, 142 &self,
146 krate: Crate, 143 krate: Crate,
147 struct_id: chalk_ir::StructId, 144 struct_id: chalk_ir::StructId,
148 ) -> Arc<chalk_rust_ir::StructDatum>; 145 ) -> Arc<chalk_rust_ir::StructDatum<chalk_ir::family::ChalkIr>>;
149 146
150 #[salsa::invoke(crate::ty::traits::chalk::impl_datum_query)] 147 #[salsa::invoke(crate::ty::traits::chalk::impl_datum_query)]
151 fn impl_datum(&self, krate: Crate, impl_id: chalk_ir::ImplId) -> Arc<chalk_rust_ir::ImplDatum>; 148 fn impl_datum(
149 &self,
150 krate: Crate,
151 impl_id: chalk_ir::ImplId,
152 ) -> Arc<chalk_rust_ir::ImplDatum<chalk_ir::family::ChalkIr>>;
153
154 #[salsa::invoke(crate::ty::traits::chalk::associated_ty_value_query)]
155 fn associated_ty_value(
156 &self,
157 krate: Crate,
158 id: chalk_rust_ir::AssociatedTyValueId,
159 ) -> Arc<chalk_rust_ir::AssociatedTyValue<chalk_ir::family::ChalkIr>>;
152 160
153 #[salsa::invoke(crate::ty::traits::trait_solve_query)] 161 #[salsa::invoke(crate::ty::traits::trait_solve_query)]
154 fn trait_solve( 162 fn trait_solve(