aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-03-06 23:11:52 +0000
committerAleksey Kladov <[email protected]>2020-03-06 23:18:04 +0000
commit9abf0d9659d0d48036c4172e29fe33770134dd61 (patch)
tree464e625dd0ca6a888800a89dbb188a480e17ec92 /crates/ra_hir_ty
parentd4cea98bc342b0aa2603106a155722dcbe5534e1 (diff)
Normalize waiting queries names
Diffstat (limited to 'crates/ra_hir_ty')
-rw-r--r--crates/ra_hir_ty/src/db.rs12
-rw-r--r--crates/ra_hir_ty/src/infer.rs4
-rw-r--r--crates/ra_hir_ty/src/lib.rs4
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)]
23pub trait HirDatabase: DefDatabase { 23pub 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
106fn infer(db: &impl HirDatabase, def: DefWithBodyId) -> Arc<InferenceResult> { 106fn 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;
63mod coerce; 63mod coerce;
64 64
65/// The entry point of type inference. 65/// The entry point of type inference.
66pub fn do_infer_query(db: &impl HirDatabase, def: DefWithBodyId) -> Arc<InferenceResult> { 66pub(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;
26pub mod method_resolution; 26pub mod method_resolution;
27mod op; 27mod op;
28mod lower; 28mod lower;
29mod infer; 29pub(crate) mod infer;
30pub mod display; 30pub mod display;
31pub(crate) mod utils; 31pub(crate) mod utils;
32pub mod db; 32pub mod db;
@@ -57,7 +57,7 @@ use crate::{
57use display::HirDisplay; 57use display::HirDisplay;
58 58
59pub use autoderef::autoderef; 59pub use autoderef::autoderef;
60pub use infer::{do_infer_query, InferTy, InferenceResult}; 60pub use infer::{InferTy, InferenceResult};
61pub use lower::CallableDef; 61pub use lower::CallableDef;
62pub use lower::{ 62pub use lower::{
63 callable_item_sig, ImplTraitLoweringMode, TyDefId, TyLoweringContext, ValueTyDefId, 63 callable_item_sig, ImplTraitLoweringMode, TyDefId, TyLoweringContext, ValueTyDefId,