Closed
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 fmt
or with rust-analyzer (makes no difference)