-
Notifications
You must be signed in to change notification settings - Fork 967
Closed
Labels
1x-backport:completedC-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICECategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICE
Milestone
Description
Describe the bug
Struct patterns that end with .. can't have a trailing comma. However, rustfmt on nightly inserts one within macro_rules!.
To Reproduce
Run rustup default nightly, then format this code:
macro_rules! foo {
($s:ident ( $p:pat )) => {
Foo {
name: Name::$s($p),
..
}
};
}Expected behavior
The comma should not be inserted to ensure that expanded code compiles.
Meta
- rustfmt version:
rustfmt 1.4.32-nightly (216a643 2021-01-16) - From where did you install rustfmt? Via rustup
- How do you run rustfmt: Either with
cargo fmtor with rust-analyzer (makes no difference)
Metadata
Metadata
Assignees
Labels
1x-backport:completedC-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICECategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICE