Skip to content

Commit 0bf0563

Browse files
committed
Add a few more db.unwind_if_cancelled() calls
1 parent 2dbc7e3 commit 0bf0563

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

crates/hir-ty/src/mir/borrowck.rs

+2
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ fn moved_out_of_ref(db: &dyn HirDatabase, body: &MirBody) -> Vec<MovedOutOfRef>
120120
Operand::Constant(_) | Operand::Static(_) => (),
121121
};
122122
for (_, block) in body.basic_blocks.iter() {
123+
db.unwind_if_cancelled();
123124
for statement in &block.statements {
124125
match &statement.kind {
125126
StatementKind::Assign(_, r) => match r {
@@ -318,6 +319,7 @@ fn ever_initialized_map(
318319
dfs(db, body, body.start_block, l, &mut result);
319320
}
320321
for l in body.locals.iter().map(|it| it.0) {
322+
db.unwind_if_cancelled();
321323
if !result[body.start_block].contains_idx(l) {
322324
result[body.start_block].insert(l, false);
323325
dfs(db, body, body.start_block, l, &mut result);

crates/hir/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1446,6 +1446,7 @@ impl DefWithBody {
14461446
}
14471447

14481448
pub fn diagnostics(self, db: &dyn HirDatabase, acc: &mut Vec<AnyDiagnostic>) {
1449+
db.unwind_if_cancelled();
14491450
let krate = self.module(db).id.krate();
14501451

14511452
let (body, source_map) = db.body_with_source_map(self.into());

0 commit comments

Comments
 (0)