aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-06-12 16:05:02 +0100
committerAleksey Kladov <[email protected]>2019-06-12 16:47:55 +0100
commitb8cae2cf8f7d2a0162d614e25ef95d7e4a5d3677 (patch)
tree464e2eaab5133f137e9d5c36fb34f6f6876c0432 /crates/ra_hir/src/ty
parentc452d2842c2ac7156178a05fe477e8832253a2c4 (diff)
check for cancellation when executing queries
Note that we can't just remove CheckCanceled trait altogether: sometimes it's useful to check for cancellation while the query is running! We do this, for example, in the name resolution fixed-point loop.
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r--crates/ra_hir/src/ty/infer.rs1
-rw-r--r--crates/ra_hir/src/ty/traits.rs1
2 files changed, 0 insertions, 2 deletions
diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs
index fef0f1d24..e150d7fd8 100644
--- a/crates/ra_hir/src/ty/infer.rs
+++ b/crates/ra_hir/src/ty/infer.rs
@@ -54,7 +54,6 @@ mod unify;
54/// The entry point of type inference. 54/// The entry point of type inference.
55pub fn infer_query(db: &impl HirDatabase, def: DefWithBody) -> Arc<InferenceResult> { 55pub fn infer_query(db: &impl HirDatabase, def: DefWithBody) -> Arc<InferenceResult> {
56 let _p = profile("infer_query"); 56 let _p = profile("infer_query");
57 db.check_canceled();
58 let body = def.body(db); 57 let body = def.body(db);
59 let resolver = def.resolver(db); 58 let resolver = def.resolver(db);
60 let mut ctx = InferenceContext::new(db, body, resolver); 59 let mut ctx = InferenceContext::new(db, body, resolver);
diff --git a/crates/ra_hir/src/ty/traits.rs b/crates/ra_hir/src/ty/traits.rs
index db78f25ca..fda7f9c04 100644
--- a/crates/ra_hir/src/ty/traits.rs
+++ b/crates/ra_hir/src/ty/traits.rs
@@ -83,7 +83,6 @@ pub(crate) fn implements_query(
83 krate: Crate, 83 krate: Crate,
84 trait_ref: Canonical<TraitRef>, 84 trait_ref: Canonical<TraitRef>,
85) -> Option<Solution> { 85) -> Option<Solution> {
86 db.check_canceled();
87 let _p = profile("implements_query"); 86 let _p = profile("implements_query");
88 let goal: chalk_ir::Goal = trait_ref.value.to_chalk(db).cast(); 87 let goal: chalk_ir::Goal = trait_ref.value.to_chalk(db).cast();
89 debug!("goal: {:?}", goal); 88 debug!("goal: {:?}", goal);