diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-11-23 09:58:36 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-11-23 09:58:36 +0000 |
commit | b1821de2c706da525d9818804be522258038f265 (patch) | |
tree | 5d575e11fafbde652773f50297ab14916973f7d8 /crates/ra_hir_def/src/db.rs | |
parent | 9da07a07eb8ced772082a136b2ac07eea1df4a2e (diff) | |
parent | 8692977d2798831d0aea434277ee54d589aa9be3 (diff) |
Merge #2369
2369: Move lang_items to hir_def r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_def/src/db.rs')
-rw-r--r-- | crates/ra_hir_def/src/db.rs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/crates/ra_hir_def/src/db.rs b/crates/ra_hir_def/src/db.rs index e91e741bb..e87bd525a 100644 --- a/crates/ra_hir_def/src/db.rs +++ b/crates/ra_hir_def/src/db.rs | |||
@@ -3,7 +3,7 @@ use std::sync::Arc; | |||
3 | 3 | ||
4 | use hir_expand::{db::AstDatabase, HirFileId}; | 4 | use hir_expand::{db::AstDatabase, HirFileId}; |
5 | use ra_db::{salsa, CrateId, SourceDatabase}; | 5 | use ra_db::{salsa, CrateId, SourceDatabase}; |
6 | use ra_syntax::ast; | 6 | use ra_syntax::{ast, SmolStr}; |
7 | 7 | ||
8 | use crate::{ | 8 | use crate::{ |
9 | adt::{EnumData, StructData}, | 9 | adt::{EnumData, StructData}, |
@@ -11,12 +11,13 @@ use crate::{ | |||
11 | body::{scope::ExprScopes, Body, BodySourceMap}, | 11 | body::{scope::ExprScopes, Body, BodySourceMap}, |
12 | data::{ConstData, FunctionData, ImplData, TraitData, TypeAliasData}, | 12 | data::{ConstData, FunctionData, ImplData, TraitData, TypeAliasData}, |
13 | generics::GenericParams, | 13 | generics::GenericParams, |
14 | lang_item::{LangItemTarget, LangItems}, | ||
14 | nameres::{ | 15 | nameres::{ |
15 | raw::{ImportSourceMap, RawItems}, | 16 | raw::{ImportSourceMap, RawItems}, |
16 | CrateDefMap, | 17 | CrateDefMap, |
17 | }, | 18 | }, |
18 | AttrDefId, ConstId, DefWithBodyId, EnumId, FunctionId, GenericDefId, ImplId, ItemLoc, StaticId, | 19 | AttrDefId, ConstId, DefWithBodyId, EnumId, FunctionId, GenericDefId, ImplId, ItemLoc, ModuleId, |
19 | StructOrUnionId, TraitId, TypeAliasId, | 20 | StaticId, StructOrUnionId, TraitId, TypeAliasId, |
20 | }; | 21 | }; |
21 | 22 | ||
22 | #[salsa::query_group(InternDatabaseStorage)] | 23 | #[salsa::query_group(InternDatabaseStorage)] |
@@ -91,4 +92,13 @@ pub trait DefDatabase2: InternDatabase + AstDatabase { | |||
91 | 92 | ||
92 | #[salsa::invoke(Attrs::attrs_query)] | 93 | #[salsa::invoke(Attrs::attrs_query)] |
93 | fn attrs(&self, def: AttrDefId) -> Attrs; | 94 | fn attrs(&self, def: AttrDefId) -> Attrs; |
95 | |||
96 | #[salsa::invoke(LangItems::module_lang_items_query)] | ||
97 | fn module_lang_items(&self, module: ModuleId) -> Option<Arc<LangItems>>; | ||
98 | |||
99 | #[salsa::invoke(LangItems::crate_lang_items_query)] | ||
100 | fn crate_lang_items(&self, krate: CrateId) -> Arc<LangItems>; | ||
101 | |||
102 | #[salsa::invoke(LangItems::lang_item_query)] | ||
103 | fn lang_item(&self, start_crate: CrateId, item: SmolStr) -> Option<LangItemTarget>; | ||
94 | } | 104 | } |