Skip to content

Commit 2c7e737

Browse files
rleungxtopecongiro
authored andcommitted
add tests for macro!(/* comment */) (#2592)
* add tests
1 parent 2e7d1a1 commit 2c7e737

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

tests/source/macros.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,3 +347,15 @@ macro lex_err($kind: ident $(, $body: expr)*) {
347347
// Preserve trailing comma on item-level macro with `()` or `[]`.
348348
methods![ get, post, delete, ];
349349
methods!( get, post, delete, );
350+
351+
// #2591
352+
fn foo() {
353+
match 0u32 {
354+
0 => (),
355+
_ => unreachable!(/* obviously */),
356+
}
357+
}
358+
359+
fn foo() {
360+
let _ = column!(/* here */);
361+
}

tests/target/macros.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,3 +922,15 @@ macro lex_err($kind: ident $(, $body: expr)*) {
922922
// Preserve trailing comma on item-level macro with `()` or `[]`.
923923
methods![get, post, delete,];
924924
methods!(get, post, delete,);
925+
926+
// #2591
927+
fn foo() {
928+
match 0u32 {
929+
0 => (),
930+
_ => unreachable!(/* obviously */),
931+
}
932+
}
933+
934+
fn foo() {
935+
let _ = column!(/* here */);
936+
}

0 commit comments

Comments
 (0)