]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #13794 - jonas-schievink:reset-step-limit-after-bump, r=jonas-schievink
authorbors <bors@rust-lang.org>
Mon, 19 Dec 2022 16:07:40 +0000 (16:07 +0000)
committerbors <bors@rust-lang.org>
Mon, 19 Dec 2022 16:07:40 +0000 (16:07 +0000)
fix: fix "parser seems stuck" panic when parsing colossal files

The parser step count is incremented every time the parser inspects a token. It's purpose is to ensure the parser doesn't get stuck in infinite loops. But since `self.pos` grows monotonically when parsing source code, it gives a better idea for whether the parser is stuck or not: if `self.pos` is changed, we know that the parser cannot be stuck, so it is safe to reset the step count to 0. This makes the limit check scale with the size of the file, and so should fix https://github.com/rust-lang/rust-analyzer/issues/13788.


Trivial merge