Skip to content

Commit 9357569

Browse files
committed
Trigger missing comma rustc suggestion
1 parent 0443daa commit 9357569

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,5 +299,5 @@ macro_rules! json_unexpected {
299299
#[macro_export]
300300
#[doc(hidden)]
301301
macro_rules! json_expect_expr_comma {
302-
($e:expr ,) => {};
302+
($e:expr , $($tt:tt)*) => {};
303303
}

tests/ui/missing_comma.stderr

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ error: no rules expected the token `"2"`
22
--> $DIR/missing_comma.rs:4:21
33
|
44
4 | json!({ "1": "" "2": "" });
5-
| ^^^ no rules expected this token in macro call
5+
| -^^^ no rules expected this token in macro call
6+
| |
7+
| help: missing comma here

0 commit comments

Comments
 (0)