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

macro_rules with parentheses #48

Closed
UtherII opened this issue May 21, 2023 · 1 comment · Fixed by #49
Closed

macro_rules with parentheses #48

UtherII opened this issue May 21, 2023 · 1 comment · Fixed by #49

Comments

@UtherII
Copy link

UtherII commented May 21, 2023

-- ❤️ --
macro_rules used with parenthesizes at the top level are prettified with braces, but the semicolon at the end is kept unchanged. The problem is the semicolon is required behind macro_rules with parenthesizes, but it causes an error behind braces.

macro_rules! x (
      () => {}  
);

is prettified to

macro_rules! x {
      () => {}  
};

I guess you should either keep parenthesizes or remove the final semicolon when switching to braces (but I'm not sure they won't be other side effect).

@dtolnay
Copy link
Owner

dtolnay commented May 23, 2023

Fixed in 0.2.6.

@dtolnay dtolnay changed the title marco_rules with parenthesizes macro_rules with parenthesizes May 23, 2023
@dtolnay dtolnay changed the title macro_rules with parenthesizes macro_rules with parentheses May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants