Skip to content

Commit 121f5e4

Browse files
committed
Add an test for #2652
1 parent d19fc45 commit 121f5e4

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Diff for: tests/source/macros.rs

+8
Original file line numberDiff line numberDiff line change
@@ -380,3 +380,11 @@ fn foo() {
380380
foo!(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
381381
foo!(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,);
382382
}
383+
384+
// #2652
385+
// Preserve trailing comma inside macro, even if it looks an array.
386+
macro_rules! bar {
387+
($m:ident) => {
388+
$m!([a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z]);
389+
};
390+
}

Diff for: tests/target/macros.rs

+8
Original file line numberDiff line numberDiff line change
@@ -961,3 +961,11 @@ fn foo() {
961961
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
962962
);
963963
}
964+
965+
// #2652
966+
// Preserve trailing comma inside macro, even if it looks an array.
967+
macro_rules! bar {
968+
($m:ident) => {
969+
$m!([a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z]);
970+
};
971+
}

0 commit comments

Comments
 (0)