After RFC amendment 1384, FOLLOW(pat) includes |
, so update tests accordingly.
This commit is contained in:
parent
3e4b7012d0
commit
c032e0c7a7
2 changed files with 10 additions and 1 deletions
|
@ -18,7 +18,6 @@ macro_rules! errors_everywhere {
|
|||
($bl:block < ) => ();
|
||||
($pa:pat >) => (); //~ ERROR `$pa:pat` is followed by `>`, which is not allowed for `pat`
|
||||
($pa:pat , ) => ();
|
||||
($pa:pat | ) => (); //~ ERROR `$pa:pat` is followed by `|`
|
||||
($pa:pat $pb:pat $ty:ty ,) => ();
|
||||
//~^ ERROR `$pa:pat` is followed by `$pb:pat`, which is not allowed
|
||||
//~^^ ERROR `$pb:pat` is followed by `$ty:ty`, which is not allowed
|
||||
|
|
|
@ -24,7 +24,17 @@ macro_rules! pat_if {
|
|||
}}
|
||||
}
|
||||
|
||||
macro_rules! pat_bar {
|
||||
($p:pat | $p2:pat) => {{
|
||||
match Some(1u8) {
|
||||
$p | $p2 => {},
|
||||
_ => {}
|
||||
}
|
||||
}}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
pat_in!(Some(_) in 0..10);
|
||||
pat_if!(Some(x) if x > 0);
|
||||
pat_bar!(Some(1u8) | None);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue