Skip to content

Commit 8af9607

Browse files
committed
fix: Panic while trying to clear old diagnostics while there's nothing
1 parent 3d2c40d commit 8af9607

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/rust-analyzer/src/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl DiagnosticCollection {
105105
flycheck_id: usize,
106106
generation: DiagnosticsGeneration,
107107
) {
108-
if self.check[flycheck_id].generation < generation {
108+
if self.check.get(flycheck_id).is_some_and(|it| it.generation < generation) {
109109
self.clear_check(flycheck_id);
110110
}
111111
}

0 commit comments

Comments
 (0)