-
Notifications
You must be signed in to change notification settings - Fork 896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustfmt crashes with bad span error #4517
Comments
Could you please provide the rustfmt version (not the rustc version) as well as a snippet that can be used to reproduce? |
rustfmt 1.4.22-nightly (97d0301 2020-10-04) |
Originally reported at rust-lang/rust#78872. btw @brmmm3 you still haven't added a code that causes the crash, that would be helpful for finding the cause of the bug. |
I know. The code I'm working on is rather big. So I have to create a small snipped which reproduces the bug. |
I'm guessing that you have nested tuple access in there @brmmm3 and that this is likely another duplicate of #4355 (which is resolved in the next nightly btw), but without a full snippet hard to say that definitively. The unclosed delimiter error is emitted by the rustc parser and is unrelated to the span panic that occurs later during formatting. Also worth noting that newer versions of rustfmt have been fixed to exit early in such cases, see v1.4.23 release notes. If it's easier than boiling down to a small snippet, you could just grab the linux binaries from our latest v1.4.24 release and run against your existing code to see if that resolves your issue. This will be the included rustfmt version in the next nightly, so tomorrow you should be able to just update to the latest nightly. |
@brmmm3 - going to close because best I can tell from the provided info, the span error is a duplicate of a fixed issue. If you're able to reproduce with rustfmt v1.4.23 or newer then feel free to re-open with relevant reproduction info |
rustfmt (nightly on Linux) crashes with error code -32900.
It is correct that it recognizes the unclosed delimiter, but I would expect a simple error message instead of a crash.
Meta
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: