aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-01-15 17:56:06 +0000
committerAleksey Kladov <[email protected]>2019-01-15 17:56:06 +0000
commit02c3d2f78eeea41c6de8430c2a34b38e1cdb861b (patch)
treed3c4cd4da2408bd1c07519880a4f5edb966890d0 /crates/ra_hir
parent8ba9c2d4cedbcf8f1d2c644733d2b06fa1984d22 (diff)
hir is cancelation free
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/src/code_model_api.rs7
-rw-r--r--crates/ra_hir/src/code_model_impl/module.rs9
2 files changed, 5 insertions, 11 deletions
diff --git a/crates/ra_hir/src/code_model_api.rs b/crates/ra_hir/src/code_model_api.rs
index 0cf45944f..0cf7deac9 100644
--- a/crates/ra_hir/src/code_model_api.rs
+++ b/crates/ra_hir/src/code_model_api.rs
@@ -1,7 +1,7 @@
1use std::sync::Arc; 1use std::sync::Arc;
2 2
3use relative_path::RelativePathBuf; 3use relative_path::RelativePathBuf;
4use ra_db::{CrateId, Cancelable, FileId}; 4use ra_db::{CrateId, FileId};
5use ra_syntax::{ast, TreeArc, SyntaxNode}; 5use ra_syntax::{ast, TreeArc, SyntaxNode};
6 6
7use crate::{ 7use crate::{
@@ -142,10 +142,7 @@ impl Module {
142 self.resolve_path_impl(db, path) 142 self.resolve_path_impl(db, path)
143 } 143 }
144 144
145 pub fn problems( 145 pub fn problems(&self, db: &impl HirDatabase) -> Vec<(TreeArc<SyntaxNode>, Problem)> {
146 &self,
147 db: &impl HirDatabase,
148 ) -> Cancelable<Vec<(TreeArc<SyntaxNode>, Problem)>> {
149 self.problems_impl(db) 146 self.problems_impl(db)
150 } 147 }
151} 148}
diff --git a/crates/ra_hir/src/code_model_impl/module.rs b/crates/ra_hir/src/code_model_impl/module.rs
index 04301ae53..a5c032d69 100644
--- a/crates/ra_hir/src/code_model_impl/module.rs
+++ b/crates/ra_hir/src/code_model_impl/module.rs
@@ -1,4 +1,4 @@
1use ra_db::{Cancelable, SourceRootId, FileId}; 1use ra_db::{SourceRootId, FileId};
2use ra_syntax::{ast, SyntaxNode, AstNode, TreeArc}; 2use ra_syntax::{ast, SyntaxNode, AstNode, TreeArc};
3 3
4use crate::{ 4use crate::{
@@ -176,12 +176,9 @@ impl Module {
176 curr_per_ns 176 curr_per_ns
177 } 177 }
178 178
179 pub fn problems_impl( 179 pub fn problems_impl(&self, db: &impl HirDatabase) -> Vec<(TreeArc<SyntaxNode>, Problem)> {
180 &self,
181 db: &impl HirDatabase,
182 ) -> Cancelable<Vec<(TreeArc<SyntaxNode>, Problem)>> {
183 let loc = self.def_id.loc(db); 180 let loc = self.def_id.loc(db);
184 let module_tree = db.module_tree(loc.source_root_id); 181 let module_tree = db.module_tree(loc.source_root_id);
185 Ok(loc.module_id.problems(&module_tree, db)) 182 loc.module_id.problems(&module_tree, db)
186 } 183 }
187} 184}