Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
poliorcetics opened this issue Aug 17, 2024 · 13 comments
Labels
C-bug Category: bug I-panic

Comments

@poliorcetics
Copy link
Contributor

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:

let mut message = "request handler panicked".to_owned();

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

@poliorcetics poliorcetics added the C-bug Category: bug label Aug 17, 2024
@ShoyuVanilla
Copy link
Member

@lnicola
Copy link
Member

lnicola commented Aug 17, 2024

Did we update rowan? I ran right away into that crash in the past when I tried to upgrade, but I didn't realize we're using the new version. It's from rust-analyzer/rowan#151.

@poliorcetics
Copy link
Contributor Author

Ohhh I know what is going on! I installed with cargo +stable install --git https://github.com/rust-lang/rust-analyzer --branch master --force rust-analyzer to test and report issues with the latest R-A when I can and the issue is I'm not passing --locked. A new version of rowan was published a day or so ago and so my last update picked it up.

So the fix is to pass --locked when installing in my case, the more general one I don't know. Should I open the issue on rowan instead ?

@lnicola
Copy link
Member

lnicola commented Aug 17, 2024

I don't know, it's more likely that we're misusing the API and the new check just happens to catch that.

@ShoyuVanilla
Copy link
Member

I don't know, it's more likely that we're misusing the API and the new check just happens to catch that.

I agree. Maybe we should check it but I'm working on other issues right now. I'll try looking into this if this is not resolved by the time I can work on this

@ShoyuVanilla
Copy link
Member

Ohhh I know what is going on! I installed with cargo +stable install --git https://github.com/rust-lang/rust-analyzer --branch master --force rust-analyzer to test and report issues with the latest R-A when I can and the issue is I'm not passing --locked. A new version of rowan was published a day or so ago and so my last update picked it up.

So the fix is to pass --locked when installing in my case, the more general one I don't know. Should I open the issue on rowan instead ?

But is this possible? The r-a is specifying the version as 0.15.15 here,

rowan = "0.15.15"

This is quite misterious 🤔

@lnicola
Copy link
Member

lnicola commented Aug 17, 2024

That just means "newer than", it's =0.15.15 if you want the exact version.

@ShoyuVanilla
Copy link
Member

That just means "newer than", it's =0.15.15 if you want the exact version.

Oh, how come I didn't know that so far 😅

bors added a commit that referenced this issue Aug 17, 2024
Pin `rowan` to `0.15.15`

To prevent #17914, I think that it would be safer pinning this before we fix it correctly
@ShoyuVanilla
Copy link
Member

Could #15710 be related?

@poliorcetics poliorcetics changed the title Error protocol error: InternalError: request handler panicked: tree is mutable when building a crate with a dependency on bevy 0.14.1 when asking for documentation Error with rowan 0.15.16: protocol error: InternalError: request handler panicked: tree is mutable when asking for documentation in big crate graphs Aug 17, 2024
@lnicola
Copy link
Member

lnicola commented Aug 17, 2024

Yeah, that will change how things work, but I don't know when it's going to happen.

@davidbarsky
Copy link
Contributor

Could #15710 be related?

@ShoyuVanilla I've summarized my current understanding of the state/approach in this comment: #15710 (comment)

@ShoyuVanilla
Copy link
Member

Could #15710 be related?

@ShoyuVanilla I've summarized my current understanding of the state/approach in this comment: #15710 (comment)

Cool! That makes clear the current status and what should be done.
I'll check if there is anything I can help it when I finish #17814

@Veykril
Copy link
Member

Veykril commented Aug 17, 2024

Worst case we can pin the current version we have in the toml file for now. You'll only run into this if the lock file gets bumped (or if you install it like OP did)

Ah you already did that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug I-panic
Projects
None yet
Development

No branches or pull requests

5 participants