diff options
| author | Michael Goulet <michael@errs.io> | 2023-01-20 21:33:24 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-20 21:33:24 -0500 |
| commit | a4f0126bfa943bf946f3130a606d56141e245fa7 (patch) | |
| tree | 91868708db82c2664154c1bb06a893e39ba0195b | |
| parent | 7168aa5eb10e0c7e879b76152b659143015772ec (diff) | |
| parent | a641b929ad35e262ed6d0e0e275b291da26a588a (diff) | |
| download | rust-a4f0126bfa943bf946f3130a606d56141e245fa7.tar.gz rust-a4f0126bfa943bf946f3130a606d56141e245fa7.zip | |
Rollup merge of #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```
| -rw-r--r-- | src/tools/tidy/src/main.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/tidy/src/main.rs b/src/tools/tidy/src/main.rs index 4c446b72a44..505f9d724c8 100644 --- a/src/tools/tidy/src/main.rs +++ b/src/tools/tidy/src/main.rs @@ -60,7 +60,7 @@ fn main() { let handle = s.spawn(|| { let mut flag = false; - $p::check($($args),* , &mut flag); + $p::check($($args, )* &mut flag); if (flag) { bad.store(true, Ordering::Relaxed); } |
