rust-lang / rust-lang/rust-analyzer

Error with `rowan 0.15.16`: `protocol error: InternalError: request handler panicked: tree is mutable` when asking for documentation in big crate graphs

Open
#17,914 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug I-panic
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

rust-analyzer version: 07659783fdfd4ec0a0bffa93017e33e31e567e42

rustc version: rustc 1.80.1 (3f5fd8dd4 2024-08-06)

editor or extension: hx

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME) none of those

code snippet to reproduce:

cd /tmp
cargo new --bin repro
cd repro
cargo add bevy
hx src/main.rs
fn main() {
    println!("Hello, world!");
}

Asking for documentation on println! fails with protocol error: InternalError: request handler panicked: tree is mutable, which comes from here I think: https://github.com/rust-lang/rust-analyzer/blob/07659783fdfd4ec0a0bffa93017e33e31e567e42/crates/rust-analyzer/src/handlers/dispatch.rs#L268

I haven't found the string tree is mutable either in Helix or R-A nor in the vendored dependencies of either

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the provided cargo and Helix commands, using the bevy dependency and a documentation request on println!. Start at crates/rust-analyzer/src/handlers/dispatch.rs around line 268 and trace the request path that produces the “tree is mutable” panic. Done means the documentation request no longer returns the internal handler-panic error for the reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.