-
Notifications
You must be signed in to change notification settings - Fork 907
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
Inner comments in binop expressions prevents formatting #5099
Comments
Thanks for the report! Could you please include the If I had to guess, I'd say that |
This is
Good point, for that I've opened another issue: #5100 |
rustfmt's inability to handle nested comments contained within a binary expression is a known, and long standing issue. It's also one that's unlikely to be resolved any time soon due the inherent complexity, especially given the tendency for chaining. See #4417 for a previous attempt at support this. I'd suggest that in general with bin expressions that readability/clarity will be improved with inline comments leading/placed above the expression as opposed to trying to embed comments within, but for those that find themselves absolutely needing embedded comments, just be aware/prepared for no reformatting support of those expressions. |
/* comment */
prevents formatting
is formatted to
but I expected
The text was updated successfully, but these errors were encountered: