-
Notifications
You must be signed in to change notification settings - Fork 908
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
Panic in SourceAnnotation when using hard_tabs = true
#6442
Comments
I tried a freshly installed nightly toolchain on Ubuntu and got the same error. Same codebase, here's the crash report: |
@lbfalvy can you please get this down to a minimal example that can be used to reproduce the error. Also, it would be good to know the exact version of rustfmt that you're using and if you're using any non-default rustfmt configs. |
@ytmimi All done, it's very similar to other SourceAnnotation bugs but I can't find the specific issue that had a really long print statement as a minimal example. For completeness' sake, here's my minimal example. repo: https://github.com/lbfalvy/orchid/tree/rustfmt-minimal-crash It's just one file: // src/main.rs
pub fn main() {
println!(
"Reeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
)
} rustfmt options: # rustfmt.toml
unstable_features = true
style_edition = "2024"
hard_tabs = true
# the following two are unstable
error_on_line_overflow = true
error_on_unformatted = true I checked, all three options are necessary to trigger the panic, any other combination results in either a successful run or an explicit formatting error. rustfmt version according to
And finally the crash file |
Thank you for the extra info! |
Because this issue involves tabs, I think this is related to #4968 (comment) |
hard_tabs = true
Just checked with main because I saw that #6391 got merged and it seems to be working fine. Thank you! |
From local testing with rustfmt 1.8.0-nightly (d97c4fb 2025-01-13) this snippet from #6442 (comment) still panics with |
@ytmimi right, then it looks like my minimal example wasn't accurate because the original full project now correctly reports an error instead of panicking. |
I see. Either way, the MCVE you provided still panics, and I think that's a good enough reason to keep the issue open |
Here's the code it died on
https://github.com/lbfalvy/orchid/tree/e0d246fe1fa75405305ec4390ba6815049246726
Logfile the panic asked me to attach
rustc-ice-2025-01-12T01_00_58-10688.txt
The text was updated successfully, but these errors were encountered: