about summary refs log tree commit diff
diff options
context:
space:
mode:
authorShoyu Vanilla (Flint) <modulo641@gmail.com>2025-08-11 15:35:38 +0000
committerGitHub <noreply@github.com>2025-08-11 15:35:38 +0000
commitc14814cb66f9d81793ac37d72d88b6819e136bc8 (patch)
tree371899268b6cf74c3ee945c9fc4972ccf318a163
parent2e4c8e2b66860ff36cb344221044917db1448777 (diff)
parent6c3c620e6b65a130a6996cca14cb9e19cc8ea65c (diff)
downloadrust-c14814cb66f9d81793ac37d72d88b6819e136bc8.tar.gz
rust-c14814cb66f9d81793ac37d72d88b6819e136bc8.zip
Merge pull request #20434 from ShoyuVanilla/diag-fix-again
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);
         }
     }