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

Parse comma-separated branches in macro definitions #4173

Merged
merged 1 commit into from
May 22, 2020

Conversation

ayazhafiz
Copy link
Contributor

A "macro" definition like

macro m {
    () => {},
    ($a:expr) => {$a},
}

has its branches separated by commas. Previously rustfmt only parsed
branches separated by semicolons, which is applicable only to
"macro_rules" definitions.

Closes #4111

A "macro" definition like

```rust
macro m {
    () => {},
    ($a:expr) => {$a},
}
```

has its branches separated by commas. Previously rustfmt only parsed
branches separated by semicolons, which is applicable only to
"macro_rules" definitions.

Closes rust-lang#4111
Copy link
Contributor

@topecongiro topecongiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@topecongiro topecongiro merged commit 2fec368 into rust-lang:master May 22, 2020
bradleypmartin pushed a commit to bradleypmartin/rustfmt that referenced this pull request May 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rustfmt keeps indenting macro definitions' bodies in macro definitions
3 participants