After RFC amendment 1384, FOLLOW(pat) includes |, so update tests accordingly.

This commit is contained in:
Felix S. Klock II 2016-01-07 00:22:47 +01:00
parent 3e4b7012d0
commit c032e0c7a7
2 changed files with 10 additions and 1 deletions

View file

@ -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

View file

@ -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);
}