update test

This commit is contained in:
mark 2021-04-15 14:27:29 -05:00
parent 0566ccc72f
commit 3f7b98ebe0
2 changed files with 4 additions and 4 deletions

View File

@ -1,9 +1,9 @@
#![feature(edition_macro_pats)]
#![allow(unused_macros)]
macro_rules! foo { ($x:pat2021 | $y:pat2021) => {} } //~ ERROR `$x:pat2021` is followed by `|`, which is not allowed for `pat2021` fragments
macro_rules! baz { ($x:pat2015 | $y:pat2015) => {} } // should be ok
macro_rules! qux { ($x:pat2015 | $y:pat2021) => {} } // should be ok
macro_rules! ogg { ($x:pat2021 | $y:pat2015) => {} } //~ ERROR `$x:pat2021` is followed by `|`, which is not allowed for `pat2021` fragments
macro_rules! baz { ($x:pat_param | $y:pat_param) => {} } // should be ok
macro_rules! qux { ($x:pat_param | $y:pat2021) => {} } // should be ok
macro_rules! ogg { ($x:pat2021 | $y:pat_param) => {} } //~ ERROR `$x:pat2021` is followed by `|`, which is not allowed for `pat2021` fragments
macro_rules! match_any {
( $expr:expr , $( $( $pat:pat2021 )|+ => $expr_arm:pat2021 ),+ ) => { //~ ERROR `$pat:pat2021` may be followed by `|`, which is not allowed for `pat2021` fragments
match $expr {

View File

@ -9,7 +9,7 @@ LL | macro_rules! foo { ($x:pat2021 | $y:pat2021) => {} }
error: `$x:pat2021` is followed by `|`, which is not allowed for `pat2021` fragments
--> $DIR/macro-pat2021-pattern-followed-by-or.rs:6:32
|
LL | macro_rules! ogg { ($x:pat2021 | $y:pat2015) => {} }
LL | macro_rules! ogg { ($x:pat2021 | $y:pat_param) => {} }
| ^ not allowed after `pat2021` fragments
|
= note: allowed there are: `=>`, `,`, `=`, `if` or `in`