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

[unstable option] format_macro_matchers #3354

Open
scampi opened this issue Feb 13, 2019 · 3 comments
Open

[unstable option] format_macro_matchers #3354

scampi opened this issue Feb 13, 2019 · 3 comments
Labels
unstable option tracking issue of an unstable option

Comments

@scampi
Copy link
Contributor

scampi commented Feb 13, 2019

Tracking issue for unstable option: format_macro_matchers

@scampi scampi added the unstable option tracking issue of an unstable option label Feb 13, 2019
@scampi scampi changed the title [unstable option] unstable option: format_macro_matchers [unstable option] format_macro_matchers Feb 18, 2019
@joshtriplett
Copy link
Member

There are a number of cases where format_macro_matchers adds spaces where Rust syntax would not normally have spaces. For instance:

-    ($cg:ident.$field:ident) => {
+    ($cg:ident. $field:ident) => {

Rust code would normally have ident.ident with no spaces.

I think this option should determine whether to include spaces around a given token based on whether that token would normally have spaces in Rust code.

@InsertCreativityHere
Copy link

InsertCreativityHere commented Nov 1, 2022

@joshtriplett @scampi
I recently opened a PR to fix the opposite issue: #5573, where it was removing a space that should be there:

 macro_rules! test_macro {
-    ($child:expr, Module) => {
+    ($child:expr,Module) => {
         let x = 11;
     };
 }

If everyone is in agreance that . shouldn't ever be followed by a space, I can take a pass at fixing it, while all the code is still fresh in my head! : v)

Personally, I don't think there's ever a reason for . to be followed by a space in 'normal' Rust, so I agree, seems like some dubious formatting to me...

@joshtriplett
Copy link
Member

joshtriplett commented Nov 5, 2022

@InsertCreativityHere I don't think there are any circumstances where . should have spaces around it, no. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unstable option tracking issue of an unstable option
Projects
None yet
Development

No branches or pull requests

3 participants