diff options
| author | Lukas Wirth <lukastw97@gmail.com> | 2023-09-02 14:39:01 +0200 |
|---|---|---|
| committer | Lukas Wirth <lukastw97@gmail.com> | 2023-09-02 14:39:19 +0200 |
| commit | 0bf0563a00e85cc4bc0c55539e1b1a38f88afcfe (patch) | |
| tree | d19fe875e7f2b2d9b76787ae46f7cb4189ec67ae | |
| parent | 2dbc7e3e1a6ca07124d3aeaddd42aa8c0bce987d (diff) | |
Add a few more `db.unwind_if_cancelled()` calls
| -rw-r--r-- | crates/hir-ty/src/mir/borrowck.rs | 2 | ||||
| -rw-r--r-- | crates/hir/src/lib.rs | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/crates/hir-ty/src/mir/borrowck.rs b/crates/hir-ty/src/mir/borrowck.rs index c651ddc2cf6..20a439bd643 100644 --- a/crates/hir-ty/src/mir/borrowck.rs +++ b/crates/hir-ty/src/mir/borrowck.rs @@ -120,6 +120,7 @@ fn moved_out_of_ref(db: &dyn HirDatabase, body: &MirBody) -> Vec<MovedOutOfRef> Operand::Constant(_) | Operand::Static(_) => (), }; for (_, block) in body.basic_blocks.iter() { + db.unwind_if_cancelled(); for statement in &block.statements { match &statement.kind { StatementKind::Assign(_, r) => match r { @@ -318,6 +319,7 @@ fn ever_initialized_map( dfs(db, body, body.start_block, l, &mut result); } for l in body.locals.iter().map(|it| it.0) { + db.unwind_if_cancelled(); if !result[body.start_block].contains_idx(l) { result[body.start_block].insert(l, false); dfs(db, body, body.start_block, l, &mut result); diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index 512fe7e0428..f113b772cf0 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -1446,6 +1446,7 @@ impl DefWithBody { } pub fn diagnostics(self, db: &dyn HirDatabase, acc: &mut Vec<AnyDiagnostic>) { + db.unwind_if_cancelled(); let krate = self.module(db).id.krate(); let (body, source_map) = db.body_with_source_map(self.into()); |
