-
Notifications
You must be signed in to change notification settings - Fork 925
version Two no longer able to format code #6157
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
Comments
rustfmt 1.7.0-nightly (d2d24e3 2024-05-03) |
@ytmimi I want to highlight this one for discussion and review as I wonder if this may be related to the v2/2024 behavior that avoids trailing comment alignment and I want to ensure we don't have any known bugs there. It appears to me as if rustfmt is, for whatever reason, attempting to capture the white space between the semi and the trailing comment and just dumping that whitespace on a newline. If this is some odd edge case then that's a bit better, but hopefully not a source of concern for the 2024 style edition |
When I run Input: fn main() {
f(0, 1,); // f()
//~^ error: this function takes 0 arguments but 2 arguments were supplied
} Output: fn main() {
f(0, 1); // f()
//~^ error: this function takes 0 arguments but 2 arguments were supplied
} A little odd to me that we're adding an indented newline between the comments. |
@calebcartwright I think this might have more to do with how we handle input fn main() {
f(0, 1,); // f()
// ~^ error: this function takes 0 arguments but 2 arguments were supplied
} output fn main() {
f(0, 1); // f()
// ~^ error: this function takes 0 arguments but 2 arguments were supplied
} |
@calebcartwright @matthiaskrgr looking through the issue tracker this seems like a duplicate of #5391 and #5868 |
with
" as
version = "Two"
it looks like rustfmt does no longer know that the comment on line 5 exists, it thus flags "
which it isnt because there is a comment after the indentation (unless it tries to remove the entire comment which is spooky as well)
The text was updated successfully, but these errors were encountered: