Skip to content

Commit a4f0126

Browse files
Rollup merge of rust-lang#107124 - DebugSteven:check-macro-expansion, r=albertlarsan68
fix check macro expansion If the only argument to `check!` is the module name I get this error: ``` error: expected expression, found `,` --> src/tools/tidy/src/main.rs:63:42 | 57 | / macro_rules! check { 58 | | ($p:ident $(, $args:expr)* ) => { 59 | | drain_handles(&mut handles); 60 | | ... | 63 | | $p::check($($args),* , &mut flag); | | ^ expected expression ... | 69 | | } 70 | | } | |_________- in this expansion of `check!` ... 117 | check!(hey); | ----------- in this macro invocation ``` This change makes it so commas are added only when there are `args`. r? ```@albertlarsan68```
2 parents 7168aa5 + a641b92 commit a4f0126

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tools/tidy/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ fn main() {
6060

6161
let handle = s.spawn(|| {
6262
let mut flag = false;
63-
$p::check($($args),* , &mut flag);
63+
$p::check($($args, )* &mut flag);
6464
if (flag) {
6565
bad.store(true, Ordering::Relaxed);
6666
}

0 commit comments

Comments
 (0)