rust-analyzer icon indicating copy to clipboard operation
rust-analyzer copied to clipboard

Panic in nightly: 'can't resolve local ptr to SyntaxNode: SyntaxNodePtr { range: 8652..8667, kind: METHOD_CALL_EXPR }

Open tekul opened this issue 4 years ago • 2 comments

Using neovim with nightly rust and rust-analyzer-preview:

rustc 1.58.0-nightly (baba6687d 2021-11-03)
rust-analyzer 04f03a3 2021-11-03 dev

LSP log with details.

I don't have a minimal reproduction yet (or public code), but the error happens when I move the cursor to the function name in the following function definition (and similarly for some other functions too).

pub fn components(&self) -> impl Iterator<Item = &'static char> {
    self.components.iter()
}

tekul avatar Nov 04 '21 16:11 tekul

Judging from the backtrace the panic is caused here https://github.com/rust-analyzer/rust-analyzer/blob/962be380042c04d195d9c120d8445e8039d340ee/crates/ide_assists/src/handlers/inline_call.rs#L118

This needs a reproduction to be fixable unfortunately

Veykril avatar Nov 04 '21 17:11 Veykril

-32603: request handler panicked: can't resolve local ptr to SyntaxNode: SyntaxNodePtr { kind: CALL_EXPR, range: 8..32 }

code: https://github.com/pacak/bpaf/tree/bug-repro

while trying to inline word_arg in src/arg.rs into all callers

Not quite minimized but shouldn't have external dependencies.

pacak avatar Sep 13 '22 02:09 pacak

Worked around in #16678.

lnicola avatar Feb 26 '24 19:02 lnicola