Skip to content
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 adds trailing spaces to macro rules #5882

Closed
matthiaskrgr opened this issue Aug 10, 2023 · 1 comment · Fixed by #5883
Closed

rustfmt adds trailing spaces to macro rules #5882

matthiaskrgr opened this issue Aug 10, 2023 · 1 comment · Fixed by #5883
Labels
a-macros e-trailing whitespace error[internal]: left behind trailing whitespace

Comments

@matthiaskrgr
Copy link
Member

macro_rules! foo {}
foo::bar!();

rustfmt --check

Diff in /home/matthias/vcs/github/rust/src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0062_mod_contents.rs at line 1:
-macro_rules! foo {}
+macro_rules! foo {
+
+}
 foo::bar!();

error[internal]: left behind trailing whitespace
 --> /home/matthias/vcs/github/rust/src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0062_mod_contents.rs:2:2:1
  |
2 |
  | ^^^^
  |

warning: rustfmt has failed to format. See previous 1 errors.

rustfmt 1.6.0-nightly (f88a8b7 2023-08-08)

@ytmimi ytmimi added a-macros e-trailing whitespace error[internal]: left behind trailing whitespace labels Aug 11, 2023
@ytmimi
Copy link
Contributor

ytmimi commented Aug 11, 2023

Thanks for the report. Confirming I can reproduce this with rustfmt 1.6.0-nightly (a72613be 2023-08-01). Also, the trailing foo::bar!(); ins't needed to reproduce the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-macros e-trailing whitespace error[internal]: left behind trailing whitespace
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants