VSCode rust-analyzer panics with index out of bounds when toolchain missing
rust-analyzer v0.4.2791-standalone panicked at crates/rust-analyzer/src/handlers/notification.rs:338:25 with "index out of bounds" while the Rust toolchain was uninstalled.

Two worker threads crashed while contributors were editing the rust-analyzer repository: "thread 'Worker9' (3966083) panicked at crates/rust-analyzer/src/handlers/notification.rs:338:25: index out of bounds: the len is 0 but the index is 0" and "thread 'Worker14' (3966088) panicked at crates/rust-analyzer/src/handlers/notification.rs:338:25: index out of bounds: the len is 0 but the index is 0." The failure site is precise: crates/rust-analyzer/src/handlers/notification.rs at column 25 of line 338 in commit 4dba1b4, with the rust-analyzer binary identified as "rust-analyzer version: 0.4.2791-standalone [/home/gh-bjorn3/.vscode-server/extensions/rust-lang.rust-analyzer-0.4.2791-linux-arm64/server/rust-analyzer]."
Logs include truncated backtraces showing the unwind path up to the bounds check: "0: __rustc::rust_begin_unwind 1: core::panicking::panic_fmt 2: core::panicking::panic_bounds_check 3: core::ops::function::FnOnce::call_once{{vtable.shim}} 4: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once 5: core::ops::function::FnOnce::call_once{{vtable.shim}} 6: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once" and the logs advise "Note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace." Timestamps tied to the errors are 2026-02-13T10:39:40.26494485Z and 2026-02-13T10:39:44.844284722Z, which bracket the sequence of flycheck and panic messages.
The report surfaces flycheck as a likely trigger point: a log line shows "world.flycheck.restart_workspace(saved_file);" followed by "2026-02-13T10:39:40.26494485Z ERROR flycheck task panicked: Any { .. }" and later "2026-02-13T10:39:44.844284722Z ERROR should have exactly one flycheck handle when invocation strategy is once." The environment was VSCode using the linux-arm64 extension build, and the runtime state included "rustc version: Rust toolchain is uninstalled." The reporter explicitly noted, "Rust-analyzer panics at some point when working on the rust-analyzer repo. Probably related to the fact that the active toolchain was not installed when rust-analyzer started." The config is described as "Fairly standard config for the rust repo."
Key missing items that would prove causality are absent from the logs: the exact code around line 338 that performs the indexing operation is not included, the full RUST_BACKTRACE output was not captured, and the reproduction steps referenced in the original report are not present in the supplied materials. The backtrace recommendation is actionable: reproduce the run with RUST_BACKTRACE=full to capture the call chain beyond the bounds check and to reveal which collection or index triggered the panic.
To help triage, capture and attach the full RUST_BACKTRACE=full output for Worker9 and Worker14, include the rust-analyzer binary path and commit id 4dba1b4, and test whether the panic occurs only when "Rust toolchain is uninstalled." Inspect crates/rust-analyzer/src/handlers/notification.rs around line 338 for unchecked indexing, and compare flycheck handle management code around "world.flycheck.restart_workspace(saved_file);" to the log "should have exactly one flycheck handle when invocation strategy is once." Those artifacts - full backtrace, binary path, commit hash, timestamps, and thread ids - will give maintainers the concrete traces needed to fix the index-out-of-bounds in v0.4.2791-standalone.
This article was produced by Prism’s automated news system from verified source data, official records, and press releases, then run through automated quality and moderation checks before publishing. The system is built and supervised by the people who set the standards it runs under. Read our full AI policy.
Did this article answer your question?


