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
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 'overflow depth reached' panic during syntax highlighting, when using aes + ctr + cipher · Issue #11370 · rust-lang/rust-analyzer · GitHub.
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 wasm-tools/crates/wasm-smith at main · bytecodealliance/wasm-tools · GitHub.
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 )
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