diff options
| author | Shoyu Vanilla <modulo641@gmail.com> | 2025-08-12 00:24:44 +0900 |
|---|---|---|
| committer | Shoyu Vanilla <modulo641@gmail.com> | 2025-08-12 00:24:44 +0900 |
| commit | 6c3c620e6b65a130a6996cca14cb9e19cc8ea65c (patch) | |
| tree | 28b407e0b4dfde72e3eb26bbade6146d9020725b | |
| parent | 1b5dbd9dfadd1019fc4447d602eda706fbf7fcdd (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.rs | 2 |
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); } } |
