Skip to content

Commit

Permalink
Ignore unused_macro_rules warning in test macros
Browse files Browse the repository at this point in the history
    warning: 2nd rule of macro `snapshot_impl` is never used
      --> tests/macros/mod.rs:44:5
       |
    44 |     (($($expr:tt)*) as $t:ty, @$snapshot:literal) => {{
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = note: `#[warn(unused_macro_rules)]` on by default

    warning: 1st rule of macro `snapshot_impl` is never used
      --> tests/macros/mod.rs:37:5
       |
    37 |     (($expr:ident) as $t:ty, @$snapshot:literal) => {
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    warning: 3rd rule of macro `snapshot_impl` is never used
      --> tests/macros/mod.rs:52:5
       |
    52 |     (($($expr:tt)*) , @$snapshot:literal) => {{
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    warning: 2nd rule of macro `spanless_eq_enum` is never used
       --> tests/common/eq.rs:225:5
        |
    225 | /     {
    226 | |         $($name:ident)::+;
    227 | |         $([$($variant:ident)::+; $($fields:tt)*])*
    228 | |         $next:ident [$([$($named:tt)*])* $(![$ignore:tt])*] (!$i:tt $($field:tt)*)
    229 | |         $($rest:tt)*
    230 | |     } => {
        | |_____^
        |
        = note: `#[warn(unused_macro_rules)]` on by default
  • Loading branch information
dtolnay committed May 13, 2022
1 parent 11b4a93 commit 189c60c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/common/eq.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(unused_macro_rules)]

extern crate rustc_ast;
extern crate rustc_data_structures;
extern crate rustc_span;
Expand Down
2 changes: 1 addition & 1 deletion tests/macros/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![allow(unused_macros)]
#![allow(unused_macros, unused_macro_rules)]

#[path = "../debug/mod.rs"]
pub mod debug;
Expand Down

0 comments on commit 189c60c

Please sign in to comment.