Merge pull request #20434 from ShoyuVanilla/diag-fix-again
Some checks failed
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
autopublish / publish (push) Has been cancelled
release / dist (aarch64-apple-darwin) (push) Has been cancelled
release / dist (x86_64-apple-darwin) (push) Has been cancelled
release / dist (aarch64-unknown-linux-gnu) (push) Has been cancelled
release / dist (arm-unknown-linux-gnueabihf) (push) Has been cancelled
release / dist (x86_64-unknown-linux-gnu) (push) Has been cancelled
release / dist (aarch64-pc-windows-msvc) (push) Has been cancelled
release / dist (x86_64-pc-windows-msvc) (push) Has been cancelled
release / dist (i686-pc-windows-msvc) (push) Has been cancelled
release / dist (x86_64-unknown-linux-musl) (push) Has been cancelled
release / publish (push) Has been cancelled

fix: Panic while trying to clear old diagnostics while there's nothing
This commit is contained in:
Shoyu Vanilla (Flint) 2025-08-11 15:35:38 +00:00 committed by GitHub
commit 9db05508ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);
}
}