diff options
author | Florian Diebold <[email protected]> | 2018-12-29 19:27:13 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2018-12-29 19:27:13 +0000 |
commit | 4142792d1fd21a512d1dd37d5822ac2ba470c547 (patch) | |
tree | d624a2b4ad749517f7946f28ad1d2874867e2032 /crates/ra_hir/src/query_definitions.rs | |
parent | 4a3d6aa26a1c71dadc91f37f9d5f8662b51c138a (diff) |
Add more docs in ty.rs
Also get rid of the indirection through query_definitions for the type-related
queries.
Diffstat (limited to 'crates/ra_hir/src/query_definitions.rs')
-rw-r--r-- | crates/ra_hir/src/query_definitions.rs | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/crates/ra_hir/src/query_definitions.rs b/crates/ra_hir/src/query_definitions.rs index 016d86ee6..721bd4195 100644 --- a/crates/ra_hir/src/query_definitions.rs +++ b/crates/ra_hir/src/query_definitions.rs | |||
@@ -19,7 +19,6 @@ use crate::{ | |||
19 | imp::Submodule, | 19 | imp::Submodule, |
20 | nameres::{InputModuleItems, ItemMap, Resolver}, | 20 | nameres::{InputModuleItems, ItemMap, Resolver}, |
21 | }, | 21 | }, |
22 | ty::{self, InferenceResult, Ty}, | ||
23 | adt::{StructData, EnumData}, | 22 | adt::{StructData, EnumData}, |
24 | }; | 23 | }; |
25 | 24 | ||
@@ -30,19 +29,6 @@ pub(super) fn fn_scopes(db: &impl HirDatabase, def_id: DefId) -> Arc<FnScopes> { | |||
30 | Arc::new(res) | 29 | Arc::new(res) |
31 | } | 30 | } |
32 | 31 | ||
33 | pub(super) fn infer(db: &impl HirDatabase, def_id: DefId) -> Cancelable<Arc<InferenceResult>> { | ||
34 | let function = Function::new(def_id); | ||
35 | ty::infer(db, function).map(Arc::new) | ||
36 | } | ||
37 | |||
38 | pub(super) fn type_for_def(db: &impl HirDatabase, def_id: DefId) -> Cancelable<Ty> { | ||
39 | ty::type_for_def(db, def_id) | ||
40 | } | ||
41 | |||
42 | pub(super) fn type_for_field(db: &impl HirDatabase, def_id: DefId, field: Name) -> Cancelable<Ty> { | ||
43 | ty::type_for_field(db, def_id, field) | ||
44 | } | ||
45 | |||
46 | pub(super) fn struct_data(db: &impl HirDatabase, def_id: DefId) -> Cancelable<Arc<StructData>> { | 32 | pub(super) fn struct_data(db: &impl HirDatabase, def_id: DefId) -> Cancelable<Arc<StructData>> { |
47 | let def_loc = def_id.loc(db); | 33 | let def_loc = def_id.loc(db); |
48 | assert!(def_loc.kind == DefKind::Struct); | 34 | assert!(def_loc.kind == DefKind::Struct); |