mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
check_canceled does not return Result
This commit is contained in:
parent
dd45697e53
commit
fedd320cf2
5 changed files with 19 additions and 7 deletions
|
@ -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?))
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue