about summary refs log tree commit diff
diff options
context:
space:
mode:
authorShoyu Vanilla <modulo641@gmail.com>2025-08-12 00:24:44 +0900
committerShoyu Vanilla <modulo641@gmail.com>2025-08-12 00:24:44 +0900
commit6c3c620e6b65a130a6996cca14cb9e19cc8ea65c (patch)
tree28b407e0b4dfde72e3eb26bbade6146d9020725b
parent1b5dbd9dfadd1019fc4447d602eda706fbf7fcdd (diff)
fix: Panic while trying to clear old diagnostics while there's nothing
-rw-r--r--src/tools/rust-analyzer/crates/rust-analyzer/src/diagnostics.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/diagnostics.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/diagnostics.rs
index 2711bdba693..30f530100f9 100644
--- a/src/tools/rust-analyzer/crates/rust-analyzer/src/diagnostics.rs
+++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/diagnostics.rs
@@ -105,7 +105,7 @@ impl DiagnosticCollection {
         flycheck_id: usize,
         generation: DiagnosticsGeneration,
     ) {
-        if self.check[flycheck_id].generation < generation {
+        if self.check.get(flycheck_id).is_some_and(|it| it.generation < generation) {
             self.clear_check(flycheck_id);
         }
     }