Subject: Re: bug#79272: [PATCH] rust-ts-mode: handle invalid rust syntax without signaling

From: Juri Linkov <[email-masked]>
Date: Thu, 21 Aug 2025 20:00:06 +0300

close 79272 31.0.50
thanks

> Avoid signaling an error when encountering invalid rust syntax. The
> signaled error would never be propagated to the user (caught somewhere
> in the fontlocking logic, I think) but it would prevent a portion of the
> buffer from being fontified.
>
> Notes:
>
> 1. I encountered  this error in `rust-ts-mode--fontify-pattern' (and
> reproduced it in the attached test). I applied the same fix to
> `rust-ts-mode--fontify-scope' to be safe, but I couldn't actually
> reproduce an issue there.
> 2. `treesit-node-parent' and `treesit-node-type' will blindly forward
> nil so there's no issue calling (treesit-node-type (treesit-node-parent
> node)) even if `node' has no parent.

I couldn't even read your patch without signaling an error :-)

But after applying it as a plain file, the test file opens correctly,
so now pushed.  Thanks.