check_canceled does not return Result

This commit is contained in:
Aleksey Kladov 2019-01-15 15:45:48 +03:00
parent dd45697e53
commit fedd320cf2
5 changed files with 19 additions and 7 deletions

View file

@ -42,7 +42,7 @@ impl Submodule {
db: &impl HirDatabase,
source: SourceItemId,
) -> Cancelable<Arc<Vec<Submodule>>> {
db.check_canceled()?;
db.check_canceled();
let file_id = source.file_id;
let file_items = db.file_items(file_id);
let module_source = ModuleSource::from_source_item_id(db, source);
@ -117,7 +117,7 @@ impl ModuleTree {
db: &impl HirDatabase,
source_root: SourceRootId,
) -> Cancelable<Arc<ModuleTree>> {
db.check_canceled()?;
db.check_canceled();
let res = create_module_tree(db, source_root);
Ok(Arc::new(res?))
}

View file

@ -327,7 +327,7 @@ where
loop {
let processed_imports_count = self.processed_imports.len();
for &module_id in self.input.keys() {
self.db.check_canceled()?;
self.db.check_canceled();
self.resolve_imports(module_id)?;
}
if processed_imports_count == self.processed_imports.len() {

View file

@ -1203,7 +1203,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
}
pub fn infer(db: &impl HirDatabase, def_id: DefId) -> Cancelable<Arc<InferenceResult>> {
db.check_canceled()?;
db.check_canceled();
let function = Function::new(def_id); // TODO: consts also need inference
let body = function.body(db)?;
let scopes = db.fn_scopes(def_id)?;