You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
verusfmt can handle this pattern up to ~27 variants on my MacBook Pro M3. It took verusfmt ~5s to format 20 variants, and the time it took to process more variants exponentially increases henceforth.
The good news (or bad news?) is that rustfmt also timed out at ~30 variants.
Just copying over my comment from Slack to track it closer to the issue:
I personally won't be able to get to this particularly soon; could you use #[verusfmt::skip]? That'll prevent the printer from trying to actually organize that portion (it'll still parse that bit, but will just put the text verbatim for any items that have the skip attribute, so hopefully you are not hitting the exponential, but are still getting good formatting for everything else in the file). If the skipped version doesn't work to speed it up and unblock you, then let me know and I'll try to see how to get at least the skipping to be faster. Improving the non-skipped perf might be a more involved change (at least how I envision it right now).
In some cases, we'd like to convert between Rust enums and structural binary sum types like:
verusfmt
can handle this pattern up to ~27 variants on my MacBook Pro M3. It tookverusfmt
~5s to format 20 variants, and the time it took to process more variants exponentially increases henceforth.The good news (or bad news?) is that
rustfmt
also timed out at ~30 variants.You can play with it using this python script: https://github.com/secure-foundations/vest/blob/main/vest-dsl/test/test_fmt_nested.py
Also related: it seems like formatting pest's autogenerated parsers (similar to what we have for Vest) is an open issue for
rustfmt
: rust-lang/rustfmt#5500, rust-lang/rustfmt#4867, rust-lang/rustfmt#4476The text was updated successfully, but these errors were encountered: