diff options
author | Aleksey Kladov <[email protected]> | 2020-03-06 23:11:52 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-03-06 23:18:04 +0000 |
commit | 9abf0d9659d0d48036c4172e29fe33770134dd61 (patch) | |
tree | 464e625dd0ca6a888800a89dbb188a480e17ec92 /crates/ra_hir_ty/src | |
parent | d4cea98bc342b0aa2603106a155722dcbe5534e1 (diff) |
Normalize waiting queries names
Diffstat (limited to 'crates/ra_hir_ty/src')
-rw-r--r-- | crates/ra_hir_ty/src/db.rs | 12 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/infer.rs | 4 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/lib.rs | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/crates/ra_hir_ty/src/db.rs b/crates/ra_hir_ty/src/db.rs index 7db28a1f8..74b309005 100644 --- a/crates/ra_hir_ty/src/db.rs +++ b/crates/ra_hir_ty/src/db.rs | |||
@@ -21,11 +21,11 @@ use hir_expand::name::Name; | |||
21 | #[salsa::query_group(HirDatabaseStorage)] | 21 | #[salsa::query_group(HirDatabaseStorage)] |
22 | #[salsa::requires(salsa::Database)] | 22 | #[salsa::requires(salsa::Database)] |
23 | pub trait HirDatabase: DefDatabase { | 23 | pub trait HirDatabase: DefDatabase { |
24 | #[salsa::transparent] | 24 | #[salsa::invoke(infer_wait)] |
25 | fn infer(&self, def: DefWithBodyId) -> Arc<InferenceResult>; | 25 | fn infer(&self, def: DefWithBodyId) -> Arc<InferenceResult>; |
26 | 26 | ||
27 | #[salsa::invoke(crate::do_infer_query)] | 27 | #[salsa::invoke(crate::infer::infer_query)] |
28 | fn do_infer(&self, def: DefWithBodyId) -> Arc<InferenceResult>; | 28 | fn infer_query(&self, def: DefWithBodyId) -> Arc<InferenceResult>; |
29 | 29 | ||
30 | #[salsa::invoke(crate::lower::ty_query)] | 30 | #[salsa::invoke(crate::lower::ty_query)] |
31 | #[salsa::cycle(crate::lower::ty_recover)] | 31 | #[salsa::cycle(crate::lower::ty_recover)] |
@@ -103,8 +103,8 @@ pub trait HirDatabase: DefDatabase { | |||
103 | ) -> Option<crate::traits::Solution>; | 103 | ) -> Option<crate::traits::Solution>; |
104 | } | 104 | } |
105 | 105 | ||
106 | fn infer(db: &impl HirDatabase, def: DefWithBodyId) -> Arc<InferenceResult> { | 106 | fn infer_wait(db: &impl HirDatabase, def: DefWithBodyId) -> Arc<InferenceResult> { |
107 | let _p = profile("wait_infer").detail(|| match def { | 107 | let _p = profile("infer:wait").detail(|| match def { |
108 | DefWithBodyId::FunctionId(it) => db.function_data(it).name.to_string(), | 108 | DefWithBodyId::FunctionId(it) => db.function_data(it).name.to_string(), |
109 | DefWithBodyId::StaticId(it) => { | 109 | DefWithBodyId::StaticId(it) => { |
110 | db.static_data(it).name.clone().unwrap_or_else(Name::missing).to_string() | 110 | db.static_data(it).name.clone().unwrap_or_else(Name::missing).to_string() |
@@ -113,7 +113,7 @@ fn infer(db: &impl HirDatabase, def: DefWithBodyId) -> Arc<InferenceResult> { | |||
113 | db.const_data(it).name.clone().unwrap_or_else(Name::missing).to_string() | 113 | db.const_data(it).name.clone().unwrap_or_else(Name::missing).to_string() |
114 | } | 114 | } |
115 | }); | 115 | }); |
116 | db.do_infer(def) | 116 | db.infer_query(def) |
117 | } | 117 | } |
118 | 118 | ||
119 | #[test] | 119 | #[test] |
diff --git a/crates/ra_hir_ty/src/infer.rs b/crates/ra_hir_ty/src/infer.rs index 437086ff6..947833412 100644 --- a/crates/ra_hir_ty/src/infer.rs +++ b/crates/ra_hir_ty/src/infer.rs | |||
@@ -63,8 +63,8 @@ mod pat; | |||
63 | mod coerce; | 63 | mod coerce; |
64 | 64 | ||
65 | /// The entry point of type inference. | 65 | /// The entry point of type inference. |
66 | pub fn do_infer_query(db: &impl HirDatabase, def: DefWithBodyId) -> Arc<InferenceResult> { | 66 | pub(crate) fn infer_query(db: &impl HirDatabase, def: DefWithBodyId) -> Arc<InferenceResult> { |
67 | let _p = profile("infer"); | 67 | let _p = profile("infer_query"); |
68 | let resolver = def.resolver(db); | 68 | let resolver = def.resolver(db); |
69 | let mut ctx = InferenceContext::new(db, def, resolver); | 69 | let mut ctx = InferenceContext::new(db, def, resolver); |
70 | 70 | ||
diff --git a/crates/ra_hir_ty/src/lib.rs b/crates/ra_hir_ty/src/lib.rs index ca194f806..4127f1a8d 100644 --- a/crates/ra_hir_ty/src/lib.rs +++ b/crates/ra_hir_ty/src/lib.rs | |||
@@ -26,7 +26,7 @@ pub mod traits; | |||
26 | pub mod method_resolution; | 26 | pub mod method_resolution; |
27 | mod op; | 27 | mod op; |
28 | mod lower; | 28 | mod lower; |
29 | mod infer; | 29 | pub(crate) mod infer; |
30 | pub mod display; | 30 | pub mod display; |
31 | pub(crate) mod utils; | 31 | pub(crate) mod utils; |
32 | pub mod db; | 32 | pub mod db; |
@@ -57,7 +57,7 @@ use crate::{ | |||
57 | use display::HirDisplay; | 57 | use display::HirDisplay; |
58 | 58 | ||
59 | pub use autoderef::autoderef; | 59 | pub use autoderef::autoderef; |
60 | pub use infer::{do_infer_query, InferTy, InferenceResult}; | 60 | pub use infer::{InferTy, InferenceResult}; |
61 | pub use lower::CallableDef; | 61 | pub use lower::CallableDef; |
62 | pub use lower::{ | 62 | pub use lower::{ |
63 | callable_item_sig, ImplTraitLoweringMode, TyDefId, TyLoweringContext, ValueTyDefId, | 63 | callable_item_sig, ImplTraitLoweringMode, TyDefId, TyLoweringContext, ValueTyDefId, |