You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rustfmt does not format a function call whose last argument does not have a trailing comma and is followed by two or more comments, with the last comment ending in a comma. E.g.:
When a single comment is present, rustfmt works correctly, with the positioning of the comment depending on whether there is a trailing comma after the last argument:
When a single comment is present, rustfmt works correctly, with the positioning of the comment depending on whether there is a trailing comma after the last argument.
The comment jumping around due to a trailing comma is related to #4848
Right now I'm not totally sure about the behavior you mentioned with two trailing comments or the reason why a trailing comma at the end of the last comment would prevent reformatting.
rustfmt does not format a function call whose last argument does not have a trailing comma and is followed by two or more comments, with the last comment ending in a comma. E.g.:
is left unchanged by rustfmt.
When the last comment does not have a comma, rustfmt works correctly, although the positioning of the first comment might be questionable:
becomes
When a single comment is present, rustfmt works correctly, with the positioning of the comment depending on whether there is a trailing comma after the last argument:
When the last argument has a trailing comma, rustfmt works correctly:
becomes
and
becomes
rustfmt version: rustfmt 1.4.38-nightly (91b9319 2021-10-23)
The text was updated successfully, but these errors were encountered: