-
Notifications
You must be signed in to change notification settings - Fork 898
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 always inserts newline before else
in let-else statement with attribute
#5901
Comments
Thanks for the report. Confirming I can reproduce this using I wish I would have caught this when implementing @calebcartwright I'm guessing we'll need to version gate this fix |
@ytmimi Thank you for triaging quickly. I'm looking at the implementation and trying to fix this issue. I'll make a PR. |
Yeah we'll have to, can't rock formatting on stable again unfortunately. Mercifully the 2024 edition won't be too terribly far out so in practice this will get cleaned up by default before too long |
Yup, that's what I thought |
@rustbot claim |
Repro
This is a code rustfmt formatted.
With some attribute on a let-else statement, rustfmt always inserts newline before
else
. When removing the attribute, this doesn't happen and rustfmt works as intended.Expected behavior
My expectation is that rustfmt does not change formatting looking at the existence of attribute:
Environment
The text was updated successfully, but these errors were encountered: