From 02c3d2f78eeea41c6de8430c2a34b38e1cdb861b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 15 Jan 2019 20:56:06 +0300 Subject: hir is cancelation free --- crates/ra_hir/src/code_model_api.rs | 7 ++----- crates/ra_hir/src/code_model_impl/module.rs | 9 +++------ 2 files changed, 5 insertions(+), 11 deletions(-) (limited to 'crates/ra_hir') 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 @@ use std::sync::Arc; use relative_path::RelativePathBuf; -use ra_db::{CrateId, Cancelable, FileId}; +use ra_db::{CrateId, FileId}; use ra_syntax::{ast, TreeArc, SyntaxNode}; use crate::{ @@ -142,10 +142,7 @@ impl Module { self.resolve_path_impl(db, path) } - pub fn problems( - &self, - db: &impl HirDatabase, - ) -> Cancelable, Problem)>> { + pub fn problems(&self, db: &impl HirDatabase) -> Vec<(TreeArc, Problem)> { self.problems_impl(db) } } 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 @@ -use ra_db::{Cancelable, SourceRootId, FileId}; +use ra_db::{SourceRootId, FileId}; use ra_syntax::{ast, SyntaxNode, AstNode, TreeArc}; use crate::{ @@ -176,12 +176,9 @@ impl Module { curr_per_ns } - pub fn problems_impl( - &self, - db: &impl HirDatabase, - ) -> Cancelable, Problem)>> { + pub fn problems_impl(&self, db: &impl HirDatabase) -> Vec<(TreeArc, Problem)> { let loc = self.def_id.loc(db); let module_tree = db.module_tree(loc.source_root_id); - Ok(loc.module_id.problems(&module_tree, db)) + loc.module_id.problems(&module_tree, db) } } -- cgit v1.2.3