-
Notifications
You must be signed in to change notification settings - Fork 909
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 dies on this line of code #4073
Comments
When you say that rustfmt "dies", does that mean that rustfmt is giving you an error, or simply that the formatting is left unchanged? |
Ah sorry for not being clearer -- It fails to format the entire file if that line is there |
It does not hard crash or anything like that. |
There's a known existing issue in rustfmt wherein if the formatted result of any single chain element exceeds the value of However, that only applies to that individual chain, and the rest of the file should be formatted. Separately, I would've thought rustfmt would emit an error as a result of the empty trailing space in that case 🤔 Are you able to share the broader file or example that shows rustfmt failing to format other items in the file? With something like this, rustfmt will indeed ignore the chain (due to the issue discussed above) but the fn main() {
let mut staff_card = foo.staff_card_hand.pick_out_card(&staff_card_name).ok_or_else(||
format_err!("We didn't have a valid card, or the card we tried to play is something the player doesn't have!")
);
}
fn foo ( ) { } |
Closing in favor of #3863 |
Hello!
Please especially note the
after the
||
. Without that, this formats just fine.Additionally, my rustfmt.toml is:
Changing almost any part of the above sample causes it to format correctly. I cannot narrow it down any further -- it seems to have something to do with line length, or maybe even the shape of the call?
The text was updated successfully, but these errors were encountered: