VS Code rust-analyzer: Request textDocument/inlayHint failed

Hello everyone, today I encountered an annoying bug with rust-analyzer.
I cloned RustCrypto's AEAD repo and opened it in VS Code, which I use as my main editor for writing Rust code.
However, when browsing through the repo in VS code rust-analyzer constantly throws this error at me:

Request textDocument/inlayHint failed.
  Message: server panicked: overflow depth reached
  Code: -32603

This appears over and over and over again whenever I click it away and it seems to pop up completely arbitrary, because it doesn't matter whether I am hovering above something, or don't have any code open at all.

Has anyone ever encountered something similar? If so how to get rid of it?

I think this is https://github.com/rust-lang/rust-analyzer/issues/11370.

What happens here is that chalk (new Rust trait solver) somehow gets confused and panics.

Historically, chalk panics are rather frequent in rust-analyzer. Folks fix them one-by-one, but this feels like a whack-a-mole game at this point. My guess would be that, to get rid of this properly, we should add randomized testing to chalk, something akin to https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasm-smith.

If anyone here looks for a very cool (but hard) Rust project to work on, this potentially sounds like a very good candidate! (note: at this time I am relatively removed from the actual work being done, so I might be talking nonsense here :slight_smile: )

2 Likes

Thanks for the explanation!
Just to make the temporary workaround visible here too:
If you encounter this error with rust-analyzer try changing its version in VS Code to v0.2.853.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.