test: add reasonable case

This commit is contained in:
hi-rustin 2021-04-14 22:31:44 +08:00
parent 7b14eda522
commit eb944c1466
2 changed files with 2 additions and 2 deletions

View file

@ -2,7 +2,7 @@
#![allow(unused_macros)]
macro_rules! foo { ($x:pat | $y:pat) => {} } //~ ERROR `$x:pat` is followed by `|`, which is not allowed for `pat` fragments
macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } //~ ERROR `$x:pat` is followed by `|`, which is not allowed for `pat` fragments
macro_rules! qux { ($x:pat) => {} } // should be ok
macro_rules! qux { ($x:pat, $y:pat) => {} } // should be ok
macro_rules! match_any {
( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => { //~ ERROR `$pat:pat` may be followed by `|`, which is not allowed for `pat` fragments
match $expr {

View file

@ -2,7 +2,7 @@
#![allow(unused_macros)]
macro_rules! foo { ($x:pat | $y:pat) => {} } // should be ok
macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } // should be ok
macro_rules! qux { ($x:pat) => {} } // should be ok
macro_rules! qux { ($x:pat, $y:pat) => {} } // should be ok
macro_rules! match_any {
( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => { // should be ok
match $expr {