diff options
| author | hi-rustin <rustin.liu@gmail.com> | 2021-04-14 22:31:44 +0800 |
|---|---|---|
| committer | hi-rustin <rustin.liu@gmail.com> | 2021-04-14 22:31:44 +0800 |
| commit | eb944c1466c4bfac0315a0f9e7727454147100a4 (patch) | |
| tree | 70c7604c65159b6aeba3636d950238dc8825b5cd | |
| parent | 7b14eda52207a8e17d2e82b915512a232f76bbec (diff) | |
| download | rust-eb944c1466c4bfac0315a0f9e7727454147100a4.tar.gz rust-eb944c1466c4bfac0315a0f9e7727454147100a4.zip | |
test: add reasonable case
| -rw-r--r-- | src/test/ui/macros/macro-pat-pattern-followed-by-or-in-2021.rs | 2 | ||||
| -rw-r--r-- | 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 { |
