tree-sitter / tree-sitter-rust

Rust grammar for tree-sitter
MIT License
359 stars 101 forks source link

bug: Assertion failed: (did_merge), function ts_parser__handle_error #215

Closed sbbddz closed 8 months ago

sbbddz commented 9 months ago

Did you check existing issues?

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

tree-sitter 0.21.0

Describe the bug

When writing a double quote just after a panic macro declaration, tree-sitter seems to crash, and so crashes my editor (nvim) with this message:

Assertion failed: (did_merge), function ts_parser__handle_error, file parser.c, line 1475.

Already reported at nvim-treesitter, got forwarded to here: https://github.com/nvim-treesitter/nvim-treesitter/issues/6189

Steps To Reproduce/Bad Parse Tree

I'm not able to reproduce the behavior other than in a concrete file in a concrete project in my system. However, I can share short video of the moment it crashes:

https://github.com/nvim-treesitter/nvim-treesitter/assets/5954310/70c73964-0449-4302-9bca-6ba1962703c9

It appears to happen only when using panic as a macro, as the video show.

Expected Behavior/Parse Tree

tree-sitter not to be crashing

Repro

No response

amaanq commented 8 months ago

fixed upstream