Skip to content

Commit

Permalink
Ignore unused_macro_rules warning in test macros
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed May 13, 2022
1 parent 249b4d4 commit 9a323ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
2 changes: 2 additions & 0 deletions tests/ui/delimiter-span.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(unused_macro_rules)]

use async_trait::async_trait;

macro_rules! picky {
Expand Down
20 changes: 6 additions & 14 deletions tests/ui/delimiter-span.stderr
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
error: no rules expected the token `{`
--> tests/ui/delimiter-span.rs:17:16
--> tests/ui/delimiter-span.rs:19:16
|
3 | macro_rules! picky {
5 | macro_rules! picky {
| ------------------ when calling this macro
...
17 | picky!({ 123, self });
19 | picky!({ 123, self });
| ^ no rules expected this token in macro call

error: no rules expected the token `{`
--> tests/ui/delimiter-span.rs:18:16
--> tests/ui/delimiter-span.rs:20:16
|
3 | macro_rules! picky {
5 | macro_rules! picky {
| ------------------ when calling this macro
...
18 | picky!({ 123 });
20 | picky!({ 123 });
| ^ no rules expected this token in macro call

warning: 1st rule of macro `picky` is never used
--> tests/ui/delimiter-span.rs:4:5
|
4 | ($(t:tt)*) => {};
| ^^^^^^^^^^
|
= note: `#[warn(unused_macro_rules)]` on by default

0 comments on commit 9a323ed

Please sign in to comment.