]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #107124 - DebugSteven:check-macro-expansion, r=albertlarsan68
authorMichael Goulet <michael@errs.io>
Sat, 21 Jan 2023 02:33:24 +0000 (21:33 -0500)
committerGitHub <noreply@github.com>
Sat, 21 Jan 2023 02:33:24 +0000 (21:33 -0500)
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```

1  2 
src/tools/tidy/src/main.rs

Simple merge