From eb944c1466c4bfac0315a0f9e7727454147100a4 Mon Sep 17 00:00:00 2001 From: hi-rustin Date: Wed, 14 Apr 2021 22:31:44 +0800 Subject: [PATCH] test: add reasonable case --- src/test/ui/macros/macro-pat-pattern-followed-by-or-in-2021.rs | 2 +- src/test/ui/macros/macro-pat-pattern-followed-by-or.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/ui/macros/macro-pat-pattern-followed-by-or-in-2021.rs b/src/test/ui/macros/macro-pat-pattern-followed-by-or-in-2021.rs index 20bfe7d7af7..f5a97eca21b 100644 --- a/src/test/ui/macros/macro-pat-pattern-followed-by-or-in-2021.rs +++ b/src/test/ui/macros/macro-pat-pattern-followed-by-or-in-2021.rs @@ -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 { diff --git a/src/test/ui/macros/macro-pat-pattern-followed-by-or.rs b/src/test/ui/macros/macro-pat-pattern-followed-by-or.rs index c2658cdbffc..54bd13d7ebc 100644 --- a/src/test/ui/macros/macro-pat-pattern-followed-by-or.rs +++ b/src/test/ui/macros/macro-pat-pattern-followed-by-or.rs @@ -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 {